The intention is feature/formant extraction from speech input.
I have used an FFT on raw samples in the past and have done simple peak picking from a weighted average of frequencies over time. That gave results that approximated a voiced non-nasal utterance's location in the vowel quadrilateral, but it was not consistent. I heard that LPC would give a smoother response curve and much greater accuracy in feature extraction. The residual is another desired side-effect which will hopefully allow for analysis of other features as well.
I have a large disparity in the peak frequencies between an FFT on the raw samples and an FFT on the derived LP coefficients.
I find that the response curves are wildly different in shape and peak frequency locations. Often FFT_LPC (see definitions below) will show large peaks in the 3000/4000Hz range for simple voiced vowel utterances. Perhaps these are pops - maybe I should perform IFFT and play back the output to check. FFT_Raw peaks precisely where I would expect given the source samples.
Here is my current method:
- Obtain samples at 22050Hz.
- From the raw sample frame, window with Hamming and perform FFT. Call this FFT_Raw.
- In parallel, extract LP coefficients from the raw samples, do NOT window, and perform FFT directly on the LP coefficients padded with zeroes. In effect, every frame would lead with these coefficients. Call this FFT_LPC.
- Take RMS of raw samples and apply an (admittedly arbitrary) multiplier to bring FFT_LPC to comparable magnitude compared with FFT_Raw.
- Display both frequency response curves with one overlaid on top of the other.
I have tried anywhere from 8 to 32 coefficients with similar results.
- Is using the coefficients directly as input to the FFT the right approach? The assumption on my end is that leading with the coefficients would approximate a unit impulse. However is there any intermediate processing that I should be doing (such as somehow shifting the starting point of each set of coefficient data to match the fundamental frequency)?
- Should the LPC data be windowed prior to FFT? I would think that my current approach of leading with the coefficients every frame means that windowing would reduce the amplitude of the first set of coefficients and FFT would produce different frequencies. However maybe if I window the raw samples and THEN use that as input to the LPC data then I will obtain more accurate results.
I have not used MATLAB or any other third party applications - the desire is to build this myself using Xcode and its accompanying libraries alone. I can display this code but it is lengthy and spans several classes (including adapter classes between data types and math/FFT operations). Ideally I would seek input on a language-agnostic conceptual level.