Finding multiple fundamental frequencies using the pitch function

7 ビュー (過去 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 Center および File ExchangeMeasurements 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