Store calculated answer for each Frame in a vector

3 views (last 30 days)
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!

Answers (1)

KSSV
KSSV on 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 Comment
George Bloomfield
George Bloomfield on 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?

Sign in to comment.

Categories

Find more on Audio I/O and Waveform Generation in Help Center and File Exchange

Products


Release

R2019b

Community Treasure Hunt

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

Start Hunting!