Store calculated answer for each Frame in a vector

3 次查看(过去 30 天)
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!

回答(1 个)

KSSV
KSSV 2020-3-4
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 个评论
George Bloomfield
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?

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Audio I/O and Waveform Generation 的更多信息

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by