5
$\begingroup$

The steps of computing the Mel-Frequency Cepstrum Coefficients (MFCC) are:

Frame blocking -> Windowing-> abs(DFT) -> Mel filter bank-> Sum coefficients for each filter-> Logarithm -> DCT

But what is the purpose of the logarithm step?

$\endgroup$

1 Answer 1

11
$\begingroup$

The logarithm serves to transform a multiplication into an addition. It is part of the computation of the cepstrum. The basic idea is as follows:

Assume a source signal $x$ is convolved by some impulse response $h$. The resulting magnitude spectrum is

$$|Y(\omega)| = |X(\omega)||H(\omega)|$$

By applying the logarithm we get

$$\log |Y(\omega)| = \log |X(\omega)| + \log |H(\omega)|\tag{1}$$

If we want to equalize / undo the effect of filtering by $H(\omega)$ we can hope that this task is easier if we transform the convolution into additive noise. This is exactly what happens by taking the logarithm in (1).

$\endgroup$
8
  • $\begingroup$ Hi Matt thanks for your answer. So the advantage is that I can remove impulse response h, as substraction? Should that substraction be performed after the DCT is computed? $\endgroup$
    – Morten
    Commented Apr 26, 2013 at 11:23
  • $\begingroup$ Yes, it is usually performed after the DCT, i.e. on the cepstral coefficients. It is a standard method used in speech recognition front ends, called 'Cepstral Mean Normalisation (CMS)' (or 'mean subtraction'). $\endgroup$
    – Matt L.
    Commented Apr 26, 2013 at 12:53
  • $\begingroup$ So DCT and mean subtraction are commutable. But if you do not perform mean subtraction, then log could (theoretically) be left out, or is there other usefull effects of it e.g. smoothing the data? $\endgroup$
    – Morten
    Commented Apr 27, 2013 at 12:58
  • $\begingroup$ Yes, in principle they are commutable, but normally there are fewer DCT coefficients than filter bank outputs, so it's more efficient to do CMS after the DCT. The function of the log operation is also to compress the data in a way similar to the human auditory system. $\endgroup$
    – Matt L.
    Commented Apr 27, 2013 at 13:38
  • 1
    $\begingroup$ @ZikO: You need the mean of the log-values. That's the whole idea, because only in the log-domain does the channel become an additive stationary noise component, which can be removed by mean subtraction. $\endgroup$
    – Matt L.
    Commented Mar 11, 2015 at 14:32

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.