I have been doing some readings on the computation of Mel-Frequency Cepstral Coefficients (MFCC) and further use of Vector Quantizers (VQ) for recognition purposes. I am however stumped by the method of computation for those MFCCs regarding the number of suggested frequency bands. For example, why is the recommended number of mel filterbank filters 20 -40? Why do we eventually end up with 13 coefficients and not 40 as will have been found from the 40 log energies we shall calculate?

  • $\begingroup$ a simple look at wiki page reveals that MFCC (the Mel-Frequency Cepstral Coefficients) are computed based on (logarithmically distributed) human auditory bands, instead of a linear so as an inital expectation there are about 10 full octaves from 30 hz to 16 khz (or 11 if you begin from 20Hz to go up 20Khz) and even further if you prefer processing 1/3 octaves, you would then have around 30-40 logaritmically distributed bands. en.wikipedia.org/wiki/Mel-frequency_cepstrum $\endgroup$ – Fat32 Feb 16 '16 at 16:34
  • $\begingroup$ Also a finer look at Mel Scale reveals that it may treat the frequency bands as linear below 1kHz and logarithmic above that, which would further change the number of bands. The specific number should, therefore, be derived based on the choosen method unless otherwise stated. $\endgroup$ – Fat32 Feb 16 '16 at 16:45
  • $\begingroup$ @Fat32 Thank you for the simple explanation on that. What about eventually ending up with 13 Mel-Frequency Cepstral Coefficients? What warrants dropping the other 27 coefficients if 40 coefficients were calculated? $\endgroup$ – Thai Monk Feb 16 '16 at 16:57
  • $\begingroup$ Sorry but I may not provide any further explanation based on the conditions. $\endgroup$ – Fat32 Feb 16 '16 at 17:10

Number of filter banks

One of the last steps in the MFCC's calculation is measuring the energy in the filter banks. We do that because want to reduce the dimensionality of our input vector (amplitude spectrum), as well as capture its envelope. Those triangular filters are spaced over the Mel scale:

enter image description here

This means that we have very good resolution in low frequencies. Exactly opposite is true for higher frequencies. We do that because MFCC's are suited for speech-related tasks and most of the information is located in lower frequencies (i.e. formants).

So how many filter banks do we actually want? For example HTK by default is using 20 filter banks. You might increase that number, especially if you are dealing with signals that contain a lot of closely spaced frequencies and you want to resolve them between each other. It's totally up to you - in the end what really matters is the classification performance.

Number of coefficients

After taking the logarithm of energies in each filter bank, the last step (or second last if you are doing some liftering) is to calculate the Mel Frequency Cepstral Coefficients. We do that by fitting the cosines to calculated log energies using the DCT. This captures the periodicity in the reduced spectrum. Figure below should help you in understanding that process. You can imagine that for number of coefficients equal to number of filter banks this would correspond to capturing the alternating energy between each of the filter banks.

enter image description here

So how many MFCC's do we want to calculate? HTK by default uses 12 and in most applications it is more than enough. In general we don't want too many coefficients because:

  • It's all about reducing the dimensionality of our feature space.
  • One DCT properties is that it de-correlates and keeps most of the information in first few coefficients.

Again it all depends on your application and you should adjust this number based on the recognition performance. From my experience the gain from increasing the number of MFCC's was negligible compared to introducing the $\Delta$ and $\Delta\Delta$ coefficients.

  • 1
    $\begingroup$ Thankyou for this detailed answer. What I am getting is that at around the twelfth coefficient, is when the periodicity in the spectrum is sufficient enough to be used? $\endgroup$ – Thai Monk Feb 21 '16 at 6:31
  • 1
    $\begingroup$ Yes, sometimes it is necessary to use higher MFCC's, especially when we know the nature of our signal. In some of my applications the upper MFCC's were the most important ones as opposed to the lower ones. $\endgroup$ – jojek Feb 21 '16 at 11:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.