Finding multiple fundamental frequencies using the pitch function

6 visualizaciones (últimos 30 días)
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

Respuesta aceptada

Walter Roberson
Walter Roberson el 11 de Jul. de 2021
WindowLength and OverlapLength turn out to be case-sensitive !
(This is a bug.)
  2 comentarios
Heeje Lee
Heeje Lee el 12 de Jul. de 2021
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 el 12 de Jul. de 2021
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)

Iniciar sesión para comentar.

Más respuestas (1)

jibrahim
jibrahim el 12 de Jul. de 2021
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

Categorías

Más información sobre Measurements and Spatial Audio en Help Center y File Exchange.

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by