Store calculated answer for each Frame in a vector

조회 수: 2 (최근 30일)
George Bloomfield
George Bloomfield 2020년 3월 4일
댓글: George Bloomfield 2020년 3월 4일
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
George Bloomfield 2020년 3월 4일
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