Store calculated answer for each Frame in a vector

3 Ansichten (letzte 30 Tage)
George Bloomfield
George Bloomfield am 4 Mär. 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!

Antworten (1)

KSSV
KSSV am 4 Mär. 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 Kommentar
George Bloomfield
George Bloomfield am 4 Mär. 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?

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Audio I/O and Waveform Generation finden Sie in Help Center und File Exchange

Produkte


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by