Hi there,
Is there a way to find the first formant of an input? I've attempted to find it manually splitting the sound into multiple frequency bands and finding the largest amplitude of this but this never seemed to work.
Thanks,
Hanns
Find first formant
Hi there,
Is there a way to find the first formant of an input? I've attempted to find it manually splitting the sound into multiple frequency bands and finding the largest amplitude of this but this never seemed to work.
Thanks,
Hanns
did you try fiddle~ or sigmund~
??
fiddle~ and sigmund~ track individual harmonics, I think, but to find formants, you need to ignore the harmonics and extract peaks from the more smoothly varying spectral envelope.
One way to do this is with cepstrum analysis, which provides a means of separating rapid (across frequency) spectral variations (the harmonics) from slower ones. An nice article on this method is Jose Padovani's "Spectral envelope extraction by means of cepstrum analysis and filtering in Pure Data":
http://puredata.info/community/conventions/convention09/padovani.pdf
The other way to do it is via linear predictive coding (LPC), which essentially designs an IIR filter that, when combined with a flat-spectrum version of the harmonic excitation, would produce the original spectrum. Searching the forum for "LPC" tuned up this: http://puredata.hurleur.com/sujet-5036-frequency-bandwidth-formants, which mentions the [ekext/lpc~] object. This will give you a list of LPC coefficients, but the problem still remains of figuring out what the formant peaks in the filter described by those coefficients are. This usually involves factoring the polynomial that the LPC coefficients represent. Here's how that could be done in Matlab: http://www.mathworks.com/help/signal/ug/formant-estimation-with-lpc-coefficients.html, but not so easy to do in PD. Maybe you could run single impulses through the [ekext/lpcreson~] filter and measure the spectrum of the output.
Coming back to fiddle~ and sigmund~, if you used them to get an accurate estimate of the fundamental frequency of the input, measuring the spectrum of a single cycle of the periodic input would also give you the spectral envelope.
Oops! Looks like something went wrong!