- Introduced by
- Bogert, Healy, Tukey
- Year
- 1963
- Type
- Spectral decomposition method
- Family
- Signal processing, Spectral analysis
What does it do?
Cepstral analysis is a spectral technique that takes the logarithm of a signal's spectrum and transforms it again, so that periodic structure in the spectrum (such as harmonic spacing or echo delays) appears as peaks at a lag called quefrency.
In the source-filter view of speech, it helps separate the slowly varying spectral envelope, shaped by the vocal tract, from the fine harmonic structure produced by the excitation. Pioneered by Bogert, Healy, and Tukey in 1963, the method underlies mel-frequency cepstral coefficients (MFCCs), which are among the most widely used features in automatic speech recognition, speaker verification, and audio analysis.
The intuition behind the method
A voiced sound has harmonics, which produce regularly spaced peaks in its spectrum. Taking the logarithm of the spectrum compresses the amplitudes, and a second Fourier transform of that log spectrum turns the regular spacing into a single peak at a lag equal to the harmonic spacing, which corresponds to the pitch period. The name is a playful reversal of 'spectrum' (its first syllable 'spec' becomes 'ceps'), and the horizontal axis of the cepstrum is called quefrency, an anagram of frequency. Quefrency has time-like units, which is why the same transform can reveal echo delays as well as pitch.
History
Bogert, Healy, and Tukey introduced the cepstrum in 1963 as a quefrency analysis of time series for detecting echoes. Davis and Mermelstein's 1980 comparison of parametric representations for word recognition found that a set of ten mel-frequency cepstrum coefficients, computed every 6.4 ms, performed best among the representations tested. MFCCs subsequently became commonly used features in speech recognition systems, and Mel-spectrograms, which are closely related to cepstral analysis, are common inputs for modern deep learning models.
When to use it
Choose cepstral analysis when the question concerns the spectral envelope of speech or other periodic sound, for example automatic speech recognition, speaker verification or identification, pitch estimation for voiced signals, or echo and reverberation analysis. MFCCs are a common compact input for classical classifiers and remain a standard baseline in speech work. Avoid it, or prefer alternatives, when fine spectral detail matters, as in many music tasks where chromagram or constant-Q features may be more suitable. It is also a poor fit for strongly nonlinear or rapidly changing signals, where its additive model does not hold. Where a learned model can take Mel-spectrograms directly, those are often used instead.
Limitations and considerations
- The additive log model assumes a linear, time-invariant filter within each frame; strongly nonlinear distortion or rapid variation within a frame violates this assumption.
- Log-Mel warping and truncation discard some spectral detail, which can matter for tasks beyond word recognition, such as music analysis and source separation.
- Cepstral pitch detection depends on a clear quefrency peak, which occurs for voiced speech but not for unvoiced consonants or fricatives.
- MFCCs vary with speaker characteristics, so speaker-independent tasks typically need normalisation such as cepstral mean normalisation.
- Two Fourier transforms and a logarithm per frame add computational cost; the cost is modest, but it is not zero in very low-power or strictly real-time settings.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Converts a filter applied to an excitation (a convolution in time) into an additive term in the log spectrum, so envelope and harmonic structure separate by quefrency.
- Liftering gives explicit control over which quefrency range is kept as the envelope and which is discarded as fine structure.
- Under the same cepstral framework, a constant channel filter becomes a constant offset in every log-spectral frame, so cepstral mean normalisation can remove it by subtracting the mean vector.
- Combined with Mel warping, the features concentrate resolution in the lower frequencies, following the perceptual scale used in the cited comparison by Davis and Mermelstein, where mel-frequency cepstrum coefficients performed best among the parametric representations tested for word recognition.
- Produces a small number of coefficients per frame, which keeps downstream models compact.
Applications
- Automatic speech recognition: MFCCs are commonly used input features for speech recognisers, including hidden Markov model and deep learning systems.
- Speaker verification and identification: cepstral coefficients carry speaker-related vocal tract characteristics and are used in speaker identification systems.
- Pitch detection: a cepstral peak at the pitch-period lag indicates the fundamental frequency of voiced speech, providing an estimate without explicit pitch tracking.
- Music information retrieval: MFCC-type cepstral features have been applied to music modelling.
- Audio forensics: cepstral features are used as inputs in speaker analysis, but their use to infer emotional state, fatigue, or authenticity is a research question rather than an established forensic method.
- Echo and reverberation analysis: high-quefrency peaks indicate repeated reflections and their delays, which can be used to characterise an acoustic environment.
How it works
How it works
Record or digitise the signal (speech, music, or environmental sound) and divide it into short, overlapping frames; typical frame lengths are 20–50 ms.
Apply pre-emphasis, a high-pass filter that boosts higher frequencies, and a window function such as Hamming or Hann to reduce leakage at frame edges. Optionally, warp the frequency axis to a perceptual scale such as Mel or Bark.
Compute the spectrum of each frame with an FFT, or pass the power spectrum through a Mel-scale filterbank. Take the logarithm of the spectrum; log power is a scaled version of log magnitude, so the choice changes only the scale of the coefficients. For the unwarped cepstrum, apply an inverse DFT (or inverse FFT) to the log spectrum to obtain the cepstrum. The Mel-warped variant (MFCCs) converts the log Mel-filterbank energies to coefficients with a different transform rather than the plain inverse DFT.
Low-quefrency components of the cepstrum describe the smooth spectral envelope (formants, filter shape), while high-quefrency components describe fine structure (harmonics, pitch). Liftering keeps or weights a chosen quefrency range, and truncating the high-quefrency part smooths the spectrum.
Extract the cepstral coefficients. Common practice in later systems is 12–13 MFCCs per frame. Davis and Mermelstein (1980) found that a set of ten mel-frequency cepstrum coefficients computed every 6.4 ms performed best in their word-recognition comparison. These coefficients capture vocal tract characteristics relevant to phoneme and speaker identity while reducing the influence of pitch and overall amplitude.
Common pitfalls
- Treating MFCCs as a complete description of speech; they were evaluated mainly for recognition accuracy and may omit phonetic or paralinguistic detail needed for other tasks.
- Choosing the liftering range poorly: too aggressive truncation smooths away formant detail, while too little leaves harmonic ripple in the envelope.
- Confusing the cepstrum with the spectrum; the cepstrum is a derived quantity whose axis is quefrency, not frequency.
- Omitting cepstral mean normalisation for cross-speaker or cross-channel tasks, where a constant offset in the coefficients can dominate the comparison.
- Using static MFCCs alone; they describe the spectral state of each frame and omit temporal change, so delta and acceleration coefficients are often appended when dynamics matter.
Frequently asked questions
What is the difference between spectrum and cepstrum?
The spectrum is the frequency-domain representation of a signal (the FFT output). The cepstrum is the spectrum of the log-spectrum, obtained by applying an FFT to the log magnitude of the FFT. The spectrum shows which frequencies are present; the cepstrum shows which periodicities are present in the spectrum. For pitch detection, the cepstrum peaks at the lag (quefrency) equal to the fundamental period.
Why are MFCCs so successful in ASR?
MFCCs combine Mel-scale frequency warping, which approximates auditory frequency resolution, with cepstral analysis, which separates the spectral envelope from fine structure. The result is a low-dimensional feature that carries much of the phonetically relevant information while being less sensitive to speaker-related harmonic detail. Common practice uses 12–13 coefficients per frame; the best-performing set in Davis and Mermelstein's (1980) word-recognition comparison used ten coefficients computed every 6.4 ms.
What is Cepstral Mean Normalization (CMN)?
CMN subtracts the mean MFCC vector, averaged over an utterance or session, from each frame. Because a constant channel filter appears as a constant offset in the cepstral coefficients, this removes much of the channel and speaker-specific offset and leaves variation that is more closely tied to phonetic content. It is especially useful when training and test recordings differ in speaker or channel.
How do I detect pitch using cepstral analysis?
Compute the cepstrum of a speech frame. For voiced speech, a prominent peak appears at the quefrency equal to the fundamental period; the reciprocal of that lag gives the pitch. Unvoiced frames usually lack a clear peak. Voicing detection and continuity tracking across frames are normally applied afterwards to refine the estimates.
Can cepstral analysis detect room reverberation and echoes?
Yes, under suitable conditions. A single echo with delay d adds a ripple to the log spectrum with period 1/d, which produces a cepstral peak at quefrency d. The zeroth coefficient reflects the overall energy rather than a direct-sound peak, so echo information appears at nonzero lags. In reverberant rooms, several reflections produce several such peaks, and their pattern can be used to characterise the acoustic environment, although estimating reverberation time or a room impulse response usually requires more than the cepstrum alone.
Related methods
Sources
Bogert, B. P., Healy, M. J., & Tukey, J. W. (1963). The quefrency alanysis of time series for echoes: cepstrum, pseudo-autocovariance, cross-cepstrum, and saphe cracking. In Time Series Analysis Research Papers (pp. 209–243). Wiley.
Open publication referenceDavis, 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 referenceRabiner, L. R., & Juang, B. H. (1993). Fundamentals of Speech Recognition. Prentice-Hall.
ISBN: 978-0130156099Machine Learning with R Important Book, p. ? (note 57)