Finding multiple fundamental frequencies using the pitch function

조회 수: 8 (최근 30일)
Heeje Lee
Heeje Lee 2021년 7월 11일
답변: jibrahim 2021년 7월 12일
I'm trying to find multiple fundamental frequencies in one audio signal. I'm currently trying to use the pitch function because I think I could use the windowlength value in the command to split up the signal into multiple frames as said in this link: https://www.mathworks.com/help/audio/ref/pitch.html
I'm currently trying the code but I keep getting an error that says "Unrecogniezed property 'windowlength' for class 'audio.internal.pitchvalidator'" and more errors that prevent it from running. I provided my code down below. If there is another method to do this other than pitch please also let me know. Thanks!
wsize = min(size(audioIn,1),192000); % 33 (I want around 10 FFs)
olength = 0;
f2 = pitch(audioIn,fs, ...
'Windowlength', size(1, wsize), ...
'Overlaplength', 0);
f0 = [f0;f2] %display purposes

채택된 답변

Walter Roberson
Walter Roberson 2021년 7월 11일
WindowLength and OverlapLength turn out to be case-sensitive !
(This is a bug.)
  댓글 수: 2
Heeje Lee
Heeje Lee 2021년 7월 12일
Thanks! But I'm still getting another error that says "Invalid Specifications. To use the NCF method, specify a valid combination of input arguments: fs/RANGE(1) < WINDOWLENGTH" I'm guessing this means to format it properly? but I am still confused what is the correct format of the code even after reading the documentation.
Image Analyst
Image Analyst 2021년 7월 12일
WindowLength needs to be a sigle number. I'm not sure what size(1, wsize) gives, unless it's an error. Normally the first argument to size is the name of the variable (array), NOT 1. And the second argument is the dimension (like 1 or 2). Maybe you meant 'Windowlength', numel(wsize)

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

jibrahim
jibrahim 2021년 7월 12일
Hi Heeje,
You've specified WindowLength as size(1,wsize). I suspect you mean wsize.
The pitch function accepts a Range property-value pair. You have not specified it, so the default applies. the default is [50,400] (values in Hertz). The error is complaining that fs/50 is not larger than the window length. I think the error will go away once you use the right window length

카테고리

Help CenterFile Exchange에서 Measurements and Spatial Audio에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by