Generic initialization of the MFCC F16 instance structure.
- Parameters
-
| [out] | S | points to the mfcc instance structure |
| [in] | fftLen | fft length |
| [in] | nbMelFilters | number of Mel filters |
| [in] | nbDctOutputs | number of Dct outputs |
| [in] | dctCoefs | points to an array of DCT coefficients |
| [in] | filterPos | points of the array of filter positions |
| [in] | filterLengths | points to the array of filter lengths |
| [in] | filterCoefs | points to the array of filter coefficients |
| [in] | windowCoefs | points to the array of window coefficients |
- Returns
- error status
- Description
- The matrix of Mel filter coefficients is sparse. Most of the coefficients are zero. To avoid multiplying the spectrogram by those zeros, the filter is applied only to a given position in the spectrogram and on a given number of FFT bins (the filter length). It is the reason for the arrays filterPos and filterLengths.
window coefficients can describe (for instance) a Hamming window. The array has the same size as the FFT length.
The folder Scripts is containing a Python script that can be used to generate the filter, dct and window arrays.
- This function should be used only if you don't know the FFT sizes that you'll need at build time. The use of this function will prevent the linker from removing the FFT tables that are not needed and the library code size will be bigger than needed.
- If you use NMSIS-DSP as a static library, and if you know the MFCC sizes that you need at build time, then it is better to use the initialization functions defined for each MFCC size.