- Introduced by
- Steven Davis, Paul Mermelstein
- Year
- 1980
- Type
- Audio feature extraction algorithm
- Family
- Audio Signal Processing
What does it do?
Mel-Frequency Cepstral Coefficients (MFCCs) are a compact set of audio features that describe the short-term spectral shape of a signal on a frequency scale modelled on human pitch perception.
Introduced by Davis and Mermelstein in 1980, they have been a long-standing standard input for speech recognition and are also used for speaker identification and environmental sound classification. Each analysis frame is reduced to a small vector of coefficients that keeps much of the phonetically relevant spectral shape while discarding fine spectral detail.
The intuition behind the method
Human hearing does not treat frequency linearly: pitch differences are judged more finely at low frequencies than at high ones. MFCCs reflect this by replacing the linear frequency axis (Hz) with the mel scale, which spaces the analysis filters accordingly. The spectrum is then compressed with a logarithm and decorrelated with a discrete cosine transform, which leaves a short vector (about 13 numbers per frame) describing the overall shape of the spectrum. Because that shape carries much of the phonetic content of speech, the vector is a useful input for recognition, although it is not a complete description of the sound.
History
Davis and Mermelstein introduced MFCCs in 1980 and compared them with other parametric representations for monosyllabic word recognition in continuously spoken sentences. Their abstract reports that the mel-frequency cepstrum gave the best recognition among the representations tested. The features were subsequently adopted widely in speech recognition. In more recent work, MFCC inputs remain common for neural models and are compared with models that take raw waveforms; for example, audio deepfake detection benchmarks evaluate MFCC-input convolutional and recurrent classifiers alongside waveform-based models.
When to use it
Choose MFCCs when the input is speech, or a sound whose identity is carried mainly by its short-term spectral envelope, and the task is recognition, speaker identification or sound classification. They are a common front end for both classical classifiers and neural networks. Do not rely on them alone for music tasks such as pitch, harmony or rhythm analysis; features such as chroma or spectral flux are usually more informative there. They are also a poor choice when the task depends on phase or on reconstructing the waveform, because phase is discarded. In noisy or uncontrolled recording conditions, plan for feature normalisation before comparing recordings. Training and test recordings should also share similar conditions, such as microphone, sample rate and background noise, because a mismatch between them is a common cause of poor accuracy.
Limitations and considerations
- Phase information is discarded, so the original waveform cannot be reconstructed from MFCCs alone.
- Each frame is treated as approximately stationary over its 20–40 ms length; the basic coefficients describe no change over time, and that information is only added through appended delta and acceleration coefficients, which are estimated from neighbouring frames.
- The representation is not designed for music. Harmonic and rhythmic structure is poorly captured by the speech-oriented filter bank and cepstral summary, so music features are usually preferred.
- Sensitivity to microphone characteristics and background noise is a practical limit. The 1980 evidence comes from a word-recognition test with two speakers, so its results do not establish performance across other speakers, channels or noise conditions.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Compact: about 13 static coefficients per frame, which keeps storage and computation small compared with full spectra.
- The mel-scale filter bank gives finer frequency resolution at low frequencies, which mirrors how pitch is perceived and concentrates detail where speech cues are dense.
- In the 1980 word-recognition comparison by Davis and Mermelstein, mel-frequency cepstrum coefficients gave the best recognition among the parametric representations tested, including linear-frequency cepstrum and linear prediction variants.
- Delta and acceleration coefficients add frame-to-frame dynamics to the static vector without changing the basic extraction steps.
Applications
- Automatic speech recognition in consumer devices (voice assistants, dictation)
- Speaker identification and verification for security applications, which should also be tested against spoofed or synthetic speech, since audio deepfake detection is a separate and active research problem
- Emotion recognition from speech in customer-service analytics; mental-health use is not supported by the original evidence and needs task-specific validation and clinical oversight before any use
- Environmental sound classification for acoustic monitoring; the original evidence covers speech only, so accuracy on the target sound classes and for surveillance use must be measured before deployment
How it works
How it works
Record audio signal at a standard sample rate (typically 16 kHz for speech).
Divide audio into short frames (20-40 ms, overlapping); apply a windowing function (Hamming window) to reduce spectral leakage.
Formula
\text{Frame audio into overlapping windows; apply windowing function (Hamming)}Compute the fast Fourier transform (FFT) of each frame; apply a bank of triangular filters spaced on the mel scale.
Formula
\text{Compute short-time Fourier transform (STFT); apply mel-scale filter bank}Take the logarithm of the mel-scale power; apply the discrete cosine transform (DCT) to decorrelate the features.
Formula
\text{Compute DCT (discrete cosine transform) of log mel-power; retain first 12-13 coefficients}Retain the first 12-13 MFCC coefficients (plus delta and acceleration derivatives); use for classification or clustering.
Common pitfalls
- Choosing the number of coefficients by convention alone. The page's 12-13 static coefficients is the usual speech setting, but the 1980 test reported its best result with ten coefficients, so the count should be checked on the target data.
- Using only the static coefficients. Omitting delta and acceleration coefficients removes the frame-to-frame change information that is often important for recognition.
- Comparing features across speakers or recording conditions without normalisation. Mean and variance normalisation is commonly applied to reduce level and channel differences; without it, recording differences can dominate the coefficients.
Frequently asked questions
Why use the mel scale instead of Hz?
Human pitch perception is closer to logarithmic than linear in frequency. The mel scale is designed to approximate this: it spaces the filters more finely at low frequencies and more coarsely at high frequencies, so spectral energy is grouped in a way that tends to keep distinctions that matter to listeners.
What are delta and acceleration coefficients?
Delta coefficients describe how each MFCC changes across neighbouring frames (a first-order time derivative); acceleration coefficients are the derivative of the deltas. Appending both to the 13 static coefficients gives 39 values per frame (13 x 3).
How do I choose the number of MFCC coefficients?
For speech, 12-13 static coefficients is the conventional choice, which with deltas and accelerations gives 39 values per frame. The 1980 comparison found that ten coefficients performed best in its own test, so treat the count as a setting to check on your data. More coefficients retain more spectral detail but can overfit when training data are limited.
Related methods
Sources
Davis, S., & Mermelstein, P. (1980). Comparison of parametric representations for monosyllabic word recognition in continuously spoken sentences. IEEE Transactions on Acoustics, Speech, and Signal Processing, 28(4), 357-366.
Open DOI referenceYoung, S. J., Evermann, G., Gales, M. J., et al. (1996). The HTK Book. Cambridge University Engineering Department.
Open publication referenceMoustakides, G. V., & Rougui, J. A. (2004). Optimal filtering for polynomial signal models. IEEE Transactions on Signal Processing, 52(8), 2219-2230.
Open publication referenceIntelligent-and-Fuzzy-Systems, p. 408