# Formant analysis LPC (Matlab)

I wanted to do formant analysis using MATLAB and did everything according to the following tutorial:

https://de.mathworks.com/help/signal/ug/formant-estimation-with-lpc-coefficients.html

I have speech signals with a sampling frequency of 44.1kHz, therefore I changed the order of the LPC estimation to 46.

But I have the following problem: the algorithm sometimes works well, but most of the time the formants are completely off. Especially for female voice. I tried to play around with the required bandwidth and lower limit for the formant frequency, but nothing yielded sufficiently good results for various voices.

I hope, that someone might have some tips for me to improve the code, such that it works more generally.

According to the documentation and my past experience with the ETSI GSM 06.10 "GSM Full Rate Speech Transcoding" standard, you should be careful in the requirements of each block of the system and the length of the segments after the pre-emphasis or segmentation blocks.

Probably you made it, but check the length of the signal before running the LPC function. And remember that we can obtain p/2 formants of the voice. GSM uses p=8 in the standard.

Cheers.

To do formant analysis you don't need such big filter order. Each spectral peak requires a pair of complex conjugates AR poles. Since speech signals are evaluated up to the 4th formant, a 8th order LPC/AR model should be sufficient for most applications.

The methods that you use for estimating the LPC model may also influence the result. Some methods are better and more stable than others. Sometimes a Kalman filter can be used to track formants across a sequence of analysis windows/blocks.

LPC analyses frequencies in the range [0, Fs/2).

The (three) formants for the human voice stop around 4kHz, but you're doing the analysis upto 22kHz!

Try downsampling the input signal, and then do an LPC of order 2*NUM_FORMANTS+1 where NUM_FORMANTS=3 or 4.