Store calculated answer for each Frame in a vector

3 vues (au cours des 30 derniers jours)
George Bloomfield
George Bloomfield le 4 Mar 2020
im using an auto correllation script to identify the given pitch of a wav file. The script works nicely but i now require to know the max and min frequency. I thought it would be useful to store each answer in a vector, so i could use the max / min arguments to achieve this. Im not sure how to extract each answer, and make the script run whilst moving along the audio file and storing the results. Do i need some sort of loop? Im pretty stuck on this so any help would be really appreciated! I attatched the matlab script and the .wav file im using. Thanks!

Réponses (1)

KSSV
KSSV le 4 Mar 2020
If you have an array and you want to store the max and min value in a vector use:
themax = zeros(10,1) ;
themin = zeros(10,1) ;
for i = 1:10
w = rand(100,1) ; % varying signal for demo
themax(i) = max(w) ;
themin(i) = min(w) ;
end
  1 commentaire
George Bloomfield
George Bloomfield le 4 Mar 2020
Thanks for your comment. My issue is more that i dopnt know how to retrieve the answers and put them in an array! ie i need my script to run, give the estimated pitch for that small segment of the wav. file, then analayse the next segment and so on. Then i need to add up all those individual pitch values, and find the highest and lowest. Any ideas on how to get the code to keep running and then store the results in a vector as it goes?

Connectez-vous pour commenter.

Catégories

En savoir plus sur Audio I/O and Waveform Generation dans Help Center et File Exchange

Produits


Version

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by