I am new in signal processing and trying to calculate formant frequency features for different .wav files.
For calcuating formant frequency, I need three parameters values :
- Linear Prediction Coefficients ( LPC )
- root
- angle
I am trying to calculate Linear Prediction Coefficients ( LPC ) using librosa.core.lpc in python. it takes two parameters:
librosa.core.lpc(y, order)
I have Y but I don't know how to calculate order, I have many .wav files and I have to set order to extract features from all the files. How to determine the order for all wav files to calculate LPC?
Next two things root and angle can be calculated easily like this :
rts = numpy.roots(A)
rts = [r for r in rts if numpy.imag(r) >= 0]
angz = numpy.arctan2(numpy.imag(rts), numpy.real(rts))
# Get frequencies.
Fs = spf.getframerate()
frqs = sorted(angz * (Fs / (2 * math.pi)))
Thank you in advance!