From Spectrum to Cepstrum in Audio Processing
The cepstrum is not the inverse of the spectrum; applying a second transform to the log spectrum separates slowly varying spectral-envelope information from faster components in quefrency.
The cepstrum of a signal is not the inverse of its spectrum. A cepstral representation is obtained by applying a second transform to the logarithmic form of the spectrum. This distinction is important for resolving a common conceptual confusion in speech-processing terminology. The spectrum shows how signal energy is distributed across frequencies. The cepstrum makes it possible to examine slow and rapid variations in the spectrum on a different axis.
I first encountered the cepstrum while examining the source code of open-source speech-recognition systems. These investigations, ranging from older systems such as CMU PocketSphinx to Kaldi, Vosk, and newer structures similar to Whisper, allowed me to see not only the theoretical definitions of concepts in the speech-processing chain but also their counterparts in real implementations. A reliable cepstral implementation cannot be reduced to writing a few equations correctly. Transform order, scaling, windowing, logarithm convention and numerical limits have to remain consistent; the gap between theory and production code usually appears in these details.
From spectrum to cepstrum
Over short intervals, a speech signal can be modeled as the combination of an excitation source and the vocal tract. In a simplified source-filter model, the vocal folds produce an excitation and the vocal tract formed by the throat and oral cavities filters it.
The time-domain relation is commonly written as a convolution:
x[n] = e[n] * h[n]Here e[n] is the excitation, h[n] is the vocal-tract impulse response, and x[n] is the observed speech signal. After the Fourier transform, convolution becomes multiplication:
X[k] = E[k] H[k]Taking the logarithm of the magnitude spectrum converts this multiplicative relation into an additive one:
log |X[k]| = log |E[k]| + log |H[k]|This is the key engineering motivation for cepstral analysis. Source and filter effects are intertwined in the waveform and in the linear spectrum; in the log spectrum they are represented additively. Applying an inverse Fourier transform to the log spectrum moves structures with different rates of spectral variation into different regions of the cepstral axis.
A common definition of the real cepstrum is:
c[n] = IDFT{log |DFT{x[n]}|}Some implementations use the power spectrum instead:
c[n] = IDFT{log |X[k]|²}These definitions do not produce the same scaling. A library that exposes a cepstrum or power-cepstrum operation should therefore state the exact convention it implements.
Although the cepstral axis has the dimension of time, it is not simply a physical delay axis. The historical term for this coordinate is quefrency. If the sampling frequency is f_s, cepstral sample n corresponds approximately to:
q_n = n / f_sPeriodic spectral structure can create a peak near the associated quefrency. For a voiced signal with fundamental frequency F0, a peak can appear around 1/F0; this is why cepstral methods can support pitch estimation. The estimate is not universally reliable: noise, weakened harmonics, overlapping speakers, short frames, and unvoiced speech can all disturb the peak. A practical pitch estimator therefore needs a bounded search interval and a voicing decision rather than an unconstrained maximum search.
Origins of the terminology
The term cepstrum was introduced by Bogert, Healy, and Tukey in 1963 in a broader time-series context concerned with echoes and periodic spectral structure. The word was created by modifying the beginning of spectrum. Related playful terms were coined in the same tradition:
- spectrum → cepstrum,
- frequency → quefrency,
- harmonics → rahmonics,
- filtering → liftering,
- phase → saphe.
The terms did not all remain equally common. Cepstrum, quefrency, and liftering are still used regularly; rahmonics is less common, while saphe and saphe cracking are encountered mainly in historical discussions of the original terminology.
Liftering means filtering in the cepstral domain. A low-quefrency lifter can emphasize the slowly varying spectral envelope, while a high-quefrency selection can emphasize harmonic or rapidly varying spectral structure. This separation is approximate rather than perfect: source and filter contributions can overlap, so liftering should be understood as selective cepstral filtering, not as a physically exact decomposition.
Types of cepstrum
Cepstrum does not denote a single mathematical representation. Several forms are used depending on which spectral quantities are preserved and how the logarithm is defined.
The real cepstrum uses the logarithm of the magnitude spectrum:
c_r[n] = IDFT{log |X[k]|}Because phase is discarded, the original waveform cannot in general be reconstructed from the real cepstrum alone. The representation is useful for spectral-envelope, periodicity, and echo-related analysis.
The power cepstrum is defined in slightly different ways across texts and libraries, commonly through the squared magnitude of a transformed log spectrum or through a log-power spectrum. Implementations should be compared only after these conventions and their scaling are made explicit.
The complex cepstrum retains magnitude and phase through a complex logarithm:
c_c[n] = IDFT{log X[k]}Computing the complex logarithm requires phase unwrapping. Using wrapped phase directly introduces discontinuities; an incorrect unwrapping step therefore corrupts the complex cepstrum. Under suitable assumptions, the complex cepstrum is useful in homomorphic analysis and minimum-phase decomposition. It preserves more information than the real cepstrum but is correspondingly more sensitive to implementation details.
Role in speech features
The best-known speech-recognition use of cepstral ideas is the Mel-frequency cepstral coefficient (MFCC) pipeline. Speech is divided into short frames, a spectrum is computed for each frame, spectral power is integrated by a Mel-spaced filter bank, the filter energies are mapped to the log domain, and a discrete cosine transform is applied.
A simplified form is:
E_m = Σ_k |X[k]|² H_m[k]
L_m = log(E_m + ε)followed by:
c_r = Σ_m L_m cos[πr(m + 1/2) / M]H_m[k] is the m-th Mel filter, M is the number of filters, and c_r is a cepstral coefficient. MFCC is therefore not simply the real cepstrum computed directly from the original Fourier spectrum. It operates on log energies after perceptual filter-bank aggregation and normally uses a DCT rather than an inverse Fourier transform. The classic comparison by Davis and Mermelstein (1980) is one of the foundational references for this representation in speech recognition.
Linear-prediction cepstral coefficients (LPCC) follow another route. They derive cepstral coefficients from a linear-prediction model that approximates speech production with an all-pole vocal-tract model. MFCC and LPCC therefore do not encode identical information and can behave differently under noise, channel variation, sampling conditions, and speaker variation.
Cepstral coefficients provide compact feature vectors by discarding part of the original spectral detail. Phase, fine harmonic structure, and high-order spectral variation are often absent from typical MFCC configurations. In classical recognition systems that information loss can be useful because the acoustic model becomes less sensitive to detail that is not directly helpful for phonetic discrimination.
Modern recognizers do not have to use cepstral coefficients. Some consume log-Mel spectrograms and others learn representations closer to the waveform. This does not invalidate cepstral analysis; it means that part of the hand-designed compression has been moved into learned feature extraction.
From source code to concept
Equations hide several choices that become explicit in production code: frame length, hop size, window function, FFT size, spectrum normalization, log base, energy flooring, DCT normalization, whether the first coefficient is retained, and whether frame energy is appended to or replaces a coefficient.
Projects such as PocketSphinx, Kaldi, and Vosk show that MFCC extraction is not an isolated call. Sampling, pre-emphasis, framing, windowing, energy computation, cepstral normalization, and temporal derivatives can all participate in the front end. Libraries such as spafe and librosa are useful for experimentation, but two feature extractors with the same name may use different defaults. A model trained with one configuration should receive the same operation order and normalization at inference time; otherwise the feature distribution can shift even though every individual operation remains mathematically valid.
A public authored artifact provides an adjacent application context without replacing the independent literature that establishes the general theory. The co-authored Image and Audio Processing — Book Chapter explicitly includes audio feature vectors and matching, audio activity and anomaly detection, automatic speech recognition, and speaker recognition/separation. The relationship is provenance for the application context; it is not evidence that the general cepstral principles themselves originate from the author.
Engineering meaning of the terminology
Cepstral terminology can initially look like scientific wordplay. The terms persisted not because the names were interesting but because the operations they represent are useful. The logarithmic spectrum converts multiplicative components into additive components. The second transform moves the spectral envelope and faster spectral variations into different quefrency regions. Liftering then allows these regions to be selected.
This framework can be used in different forms for speech recognition, audio modeling, fundamental-frequency estimation, echo analysis, and forensic audio examination. Not every application uses the same cepstrum definition or coefficient set. The method name alone is not a sufficient technical description. The transform type, parameters, and preserved information should be stated explicitly.
The relationship between cepstrum and spectrum should therefore not be interpreted as an inverse relationship. Cepstrum is another representation space derived from the spectrum. It reorganizes structures from the frequency axis on the quefrency axis, making selected signal components easier to examine directly.
The historical creativity of cepstral terminology should not overshadow the mathematical method. Its engineering value comes from its approximate separation of source and filter effects in speech production and its conversion of high-dimensional spectral information into manageable features. Open-source code, academic work, and my own software-development process showed that this transformation is far more than a theoretical curiosity.
Relationship to MFCC
This page treats the cepstrum as a general mathematical transformation. The speech-oriented pipeline that adds Mel scaling, a filter bank and coefficient selection is covered separately in Speech Feature Extraction with MFCC.
References
- Alan V. Oppenheim; Ronald W. Schafer. (2004). From Frequency to Quefrency: A History of the Cepstrum. IEEE Signal Processing Magazine, 21(5), 95-106. doi:10.1109/MSP.2004.1328092
- Alec Radford; Jong Wook Kim; Tao Xu; Greg Brockman; Christine McLeavey; Ilya Sutskever. (2022). Robust Speech Recognition via Large-Scale Weak Supervision. arXiv. doi:10.48550/arXiv.2212.04356
- Bruce P. Bogert; M. J. R. Healy; John W. Tukey. (1963). The Quefrency Alanysis of Time Series for Echoes: Cepstrum, Pseudo-Autocovariance, Cross-Cepstrum and Saphe Cracking. Proceedings of the Symposium on Time Series Analysis, Wiley.
- Lawrence R. Rabiner; Ronald W. Schafer. (1978). Digital Processing of Speech Signals. Prentice-Hall.
- Steven Davis; Paul Mermelstein. (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. doi:10.1109/TASSP.1980.1163420