I found this description. According to this, the next step is a "binning" where

binning means that each FFT magnitude coefficient is multiplied by the corresponding filter gain and the results accumulated. What is the exact procedure they are describing?


2 Answers 2


Binning is an averaging operation on the (squared) magnitudes of the DFT. You would maybe have $256$ DFT bins but only around $20$ outputs of the filter bank. So you need to average groups of DFT bins to reduce the dimension from $256$ to $20$. For a mel-scaled filter bank, the averaging functions (kernels) are usually triangular, i.e. the center DFT bins get more weight than the rest. As an example, let the first kernel that is used for averaging the lowest DFT frequencies be stored in an array $W_1[k]$, $k=0,\ldots,K-1$, then the output of that filter bank channel is computed as


where $R[k]$ are the (squared) DFT magnitudes. In this way you compute all $20$ filter bank outputs. You just need to know (define) the weights $W_i[k]$ and the range of DFT indices that are averaged by the respective kernel.

This answer to a related question might also be helpful (also have a look at the comments).

  • $\begingroup$ thank you for your answer.. Can you please have a look at my edited question?.. Are the calculations looking good? (the used algorithm for DFT (FFT) is requiring n² datapoints (does this affect the MFCC?).. I do not know how to proceed.. what is the parameter 'k' in my case? $\endgroup$
    – Jan
    Commented Feb 26, 2017 at 21:47
  • $\begingroup$ ps I know it is a bad example as there are fewer/same number of mfcc-bins and dct-bins.. but i wanted it to be comprehensible.. $\endgroup$
    – Jan
    Commented Feb 27, 2017 at 9:01
  • $\begingroup$ @Jan: Your original question was about binning, i.e., about using the filter bank on the output of the DFT. That's what I've tried to explain. Is it still unclear? I do not intend to look at long rows of numbers to judge whether they "look good" or not. $\endgroup$
    – Matt L.
    Commented Feb 27, 2017 at 9:08
  • $\begingroup$ yes it is still unclear... What is $k$? I have an one-dimensional Filterbank.. ($1*n$).. And what do you mean by 'the lowest DFT frequencies'? $\endgroup$
    – Jan
    Commented Feb 27, 2017 at 9:50
  • $\begingroup$ @Jan: $k$ is just an index running through the DFT bins that are being averaged to get one filter bank output. And $K$ is the number of bins averaged by the first kernel. You decide what $K$ is, or which specification you want to follow. By "lowest DFT frequencies" I literally mean the lowest (starting from frequency zero); you take the first $K$ frequencies, weigh them, and add them up to obtain the output of the first filter bank channel. And similarly for all other channels. $\endgroup$
    – Matt L.
    Commented Feb 27, 2017 at 9:54

You can find some examples in the Voicebox matlab toolbox:


At the Mathworks website you can find a possible answer:


Can you post your own version or efforts?

Concerning your specific question about the filter banks:

Find maximum frequency in Mels: If your frequency range is 300Hz-8kHz for example you will have 401-2835 Mels (using freq. to Mels convertions). Find bin center Mel freq: If you want 10 bins you must have 12 points eleven zones; so bin width=(2835-401)/11=222; the bins will be approx: bwm(i) = 401.3, 622.5, 843.8, 1065.0, 1286.3, 1507.5, 1728.8, 1950.0, 2171.2, 2392.5, 2613.8, 2835; Convert Mel freq back to lin freq: values will be: bwf(i) = 300, 517, 782, 1104, 1496, 1973, 2554, 3262, 4123, 5171, 6446, 8000; Then you can proceed with the calculations.

Some code:

% for plotting
x2= zeros(1,n+2);
hold on
hold off

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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