# Cepstrum
The **cepstrum** of a [[Signal|signal]] is obtained by taking a second, Fourier-type transform of the logarithm of the signal's own magnitude spectrum: informally, the spectrum of a log-spectrum. Because a multiplicative effect in the ordinary spectrum, such as a comb of ripples imposed by a delayed echo, becomes an additive, periodic ripple once the logarithm is taken, that ripple shows up in the cepstrum as a single sharp peak rather than as a faint pattern spread across many frequencies. The primary microsim on this page builds a source pulse plus one delayed echo, computes the cepstrum of the pair, and lets the reader drag the echo's delay and strength directly, watching the peak in the cepstrum track the true delay as a diagnostics readout reports how close the two are.
The transform's own axis is not frequency but quefrency, and it carries units of time, because a second transform of a frequency-domain quantity undoes the first transform's own units. Filtering operations performed on this axis are correspondingly called liftering rather than filtering, the same idea of keeping or removing a range applied to quefrency instead of frequency, and it is exactly how a signal's slowly varying spectral envelope is separated from a periodic excitation riding on top of it, the split that makes the cepstrum the standard tool for pitch detection and echo detection alike.
## Origin
The names cepstrum, quefrency and liftering are a deliberate set of coinages, formed by reversing or otherwise playing with letters from spectrum, frequency and filtering, and introduced together in a single paper on detecting echoes in time series.[^origin-name] The same paper's authors extended the wordplay further, calling a secondary peak at twice or three times the fundamental quefrency a rahmonic, echoing "harmonic" the way quefrency echoes "frequency," a deliberate nod to the ordinary harmonic series, where the nth harmonic sits at n times a fundamental frequency.[^harmonic-092] The construction predates its playful name in substance if not in label: recognizing that a hidden periodicity in a spectrum is far easier to spot as a single feature after this treatment than as a ripple spread across many frequency bins is the same insight behind every application discussed below, from a seismic echo to a human voice's pitch.
## General definition
Given a signal `x[n]`, its real cepstrum is `c[n] = IFFT( log|FFT(x)| )`: take the discrete [[Fourier_transform|Fourier transform]], in practice the [[Fast_Fourier_transform|fast Fourier transform]], take the logarithm of its magnitude only, and transform back. Because the magnitude spectrum of a real signal is even, the result is itself real, which is what makes the real cepstrum both easy to compute and, by construction, blind to the original signal's phase. The independent variable that comes back out of the second transform is measured in the same units as the original signal's own time axis, seconds or samples, but it is called quefrency rather than time to mark that it has passed through a full round trip out of the [[Time_domain]]: time to frequency to log-magnitude and back to a time-like axis, rather than remaining time throughout.
The construction works because of a single property of the logarithm applied in the [[Frequency_domain|frequency domain]]: it turns a product into a sum. If a spectrum is the product of two factors, `X = S · (1 + alpha·e^{-jωτ})` for a source spectrum `S` and an echo term with delay τ and strength alpha, the log of that product is the sum `log|S| + log|1 + alpha·e^{-jωτ}|`, and the second term is periodic in frequency with period `2π/τ`. A periodic ripple in one Fourier domain is, to a second transform, a single spike, which is why the echo announces itself in the cepstrum as one clean peak at quefrency τ, exactly where the sketch on this page places it.
## Types
Three closely related constructions share the name. The power cepstrum takes the log-magnitude squared before transforming back, `|IFFT(log|FFT(x)|^2)|^2`, and is the version most often meant by "the cepstrum" without qualification; keeping only the real part of the plain inverse transform of the log-magnitude, without the squares, gives the real cepstrum described above, which differs from the power cepstrum only by a scale and squaring convention, not in the information it carries. Both discard the original spectrum's phase entirely, which is enough for detecting where a peak sits but not for reconstructing the original signal from its cepstrum.
The complex cepstrum keeps that phase by transforming the full complex logarithm, `log(X(f)) = log|X(f)| + j·arg(X(f))`, rather than the magnitude alone, at the cost of first unwrapping the phase into a continuous function of frequency so the logarithm is well defined. Because no information is thrown away, the complex cepstrum is invertible: the original signal can be recovered from it exactly, which is what makes it the version used for genuine deconvolution rather than only for detecting that two signals have been convolved together. It is also the natural way to split a system into its minimum-phase and maximum-phase parts, since those correspond to the complex cepstrum's causal and anticausal halves, the same distinction a [[Pole–zero_plot|pole–zero plot]] makes by sorting poles and zeros inside or outside the unit circle of the [[Z-transform|z-plane]].
## Related concepts
Turning a [[Convolution|convolution]] into a sum by taking a logarithm is an instance of homomorphic signal processing generally, of which the cepstrum is the best-known example, and one closely related to the [[Spectral_density|spectral density]] whose logarithm it operates on: convolving two signals in time multiplies their spectra, the logarithm turns that product into a sum, and the two convolved parts can then be pulled apart by ordinary linear filtering of the log-spectrum, or, equivalently, of the cepstrum itself. Mel-frequency cepstral coefficients, built from a warped, perceptually motivated version of the same construction, are the standard front end of automatic speech and speaker recognition systems and of many other audio [[Machine_learning|machine-learning]] pipelines, valued because they compress a [[Spectrogram|spectrogram]]'s worth of information into a short, largely decorrelated vector per analysis frame.[^mfcc-orig] The cepstrum is also related to [[Autocorrelation]] as a way of finding a hidden periodicity, though the two respond differently to noise and to the relative strength of the periodic component, which is part of why both remain in use rather than one replacing the other.
## Interpretation
The clearest illustration is speech. A voiced sound is well modeled as a train of glottal pulses, spaced one pitch period apart, driving a vocal-tract filter whose resonances are the formants: in the frequency domain the spectrum is the product of the pulse train's own line spectrum and the vocal tract's smooth transfer function, `S(f) = P_T(f) · H_V(f)`.[^source-filter] The pulse train's spectrum is periodic in frequency, with lines spaced at the pitch frequency; the vocal tract's spectrum is smooth and slowly varying. Taking the log turns the product into a sum of a fast, periodic ripple and a slow envelope, and the second Fourier-type transform separates them by quefrency: the slow envelope, carrying the formant information, collapses to low quefrency near zero, while the fast, periodic ripple from the pulse train collapses to a sharp peak at a quefrency equal to the pitch period itself — for a voice pitched at 110 Hz, for instance, that period is about 9.1 ms.[^pitch-example] Liftering, in this light, is nothing more exotic than a [[Low-pass_filter|low-pass]] or high-pass operation applied on the quefrency axis: keeping only low quefrency recovers a smoothed spectral envelope with the pitch ripple removed, and keeping only high quefrency isolates the excitation and, with it, the pitch.
## Applications
Echo detection is the cepstrum's original application and its most direct: a radar or sonar return, or a seismic reflection, that contains a signal plus a delayed, attenuated copy of itself produces a spectrum with exactly the multiplicative ripple this article's sketch reproduces, and the cepstrum turns the otherwise hard problem of measuring that ripple's period into the easy one of finding a peak. The same logic applies to acoustic [[Reverberation|reverberation]] and to any other setting where a signal reaches a receiver by more than one path with a measurable time difference between them, making the cepstrum a natural complement to ordinary [[Matched_filter|matched filtering]] and [[Detection_theory|detection theory]] wherever the delay itself, not just the signal's presence, is what needs measuring.
In speech and audio, the same separation of a periodic excitation from a smooth envelope underlies pitch detection, voice and speaker characterization, and the front end of most [[Audio_signal_processing|audio signal processing]] pipelines built for recognition rather than for reproduction. Because the technique needs only a spectrum's magnitude to work, it transfers easily to any domain where a signal's spectrum is available, including [[Radar]] and [[Sonar]] returns and vibration records used to diagnose a rotating machine's repeating faults from the spacing of their own harmonics.
## Microsims
This article carries one sketch, built around exactly the echo model above.
**Cepstrum** builds a signal `x[n] = s[n] + alpha·s[n-tau]`, a pulse plus one delayed, scaled echo, runs it through a hand-written [[Fast_Fourier_transform|FFT]], takes the log-magnitude spectrum, and inverse-transforms back to the cepstrum, redrawing all three panels only when a control actually changes. Draggable handles set the echo's delay tau and its strength alpha directly on the signal panel, a keyboard shortcut adds measurement noise to the spectrum, and a diagnostics readout compares the detected peak's quefrency against the true delay that produced it.
*Try:* Press N to add noise to the spectrum and watch how far the detected peak can wander from the true tau it is supposed to find.
A three.js companion renders the same idea over an actual echo: a spectrum's periodic ripple collapsing, under the second transform, to a single peak at the echo's own delay.
<!-- SIGSIM:BEGIN g35 — Signal Processing portal microsim (framework build, specs/sims/Cepstrum.json); do not hand-edit inside -->
**Microsim — three.js (Wikitube framework), pending deploy:** *The cepstrum: an echo becomes a peak at its delay* will play here once `https://wikitube-3d-microsims.netlify.app/signal/Cepstrum.html` is live.
<!-- pending: <div class="wt-sim" data-src="https://wikitube-3d-microsims.netlify.app/signal/Cepstrum.html" data-title="Cepstrum"></div> -->
*Built from `MICROSIM_GUIDE/specs/sims/Cepstrum.json`; part of the [[Signal_processing]] set ([[PORTAL_Signal_Processing]]).*
<!-- SIGSIM:END -->
## Wikipedia : Wikitube
**Strict pair:** [Wikipedia](https://en.wikipedia.org/wiki/Cepstrum) : [Wikitube](https://en.wikitube.io/wiki/Cepstrum)
Skeleton mirrored at revision 1373201613. Prose, emphasis and the microsims are Wikitube's own.
## References
[^origin-name]: Citation needed: a primary citation (author, title, venue, year) for the 1963 paper introducing the terms cepstrum, quefrency, liftering and rahmonic.
[^harmonic-092]: Schmidt-Jones, C. *Understanding Basic Music Theory*. 2013, pp. 117–118 (PDF pages): the nth harmonic of a string or tube has frequency n times the fundamental. Open Textbook Library: https://open.umn.edu/opentextbooks/textbooks/understanding-basic-music-theory-2013 . CC BY.
[^mfcc-orig]: Citation needed: a primary citation (author, title, venue, year) for the original Mel-frequency cepstral coefficient construction.
[^source-filter]: Johnson, D. *Fundamentals of Electrical Engineering I*. 2014, p. 129 (PDF page): the source–filter speech model, S(f) = P_T(f)·H_V(f), with the glottal pulse train as source and the vocal tract as an LTI filter whose resonances are the formants. Open Textbook Library: https://open.umn.edu/opentextbooks/textbooks/fundamentals-of-electrical-engineering-1 . CC BY.
[^pitch-example]: Johnson, D. *Fundamentals of Electrical Engineering I*. 2014, p. 130 (PDF page): a 110 Hz pitch corresponds to a period of about 9.1 ms. Open Textbook Library: https://open.umn.edu/opentextbooks/textbooks/fundamentals-of-electrical-engineering-1 . CC BY.
## Further reading
- Don Johnson. *Fundamentals of Electrical Engineering I* (2014). Open Textbook Library: https://open.umn.edu/opentextbooks/textbooks/fundamentals-of-electrical-engineering-1
- Michael Stiber; Bilin Stiber; Eric Larson. *Signal Computing: Digital Signals in the Software Domain* (2020). Open Textbook Library: https://open.umn.edu/opentextbooks/textbooks/signal-computing-digital-signals-in-the-software-domain
- Allen Downey. *Think DSP: Digital Signal Processing in Python* (2012). Open Textbook Library: https://open.umn.edu/opentextbooks/textbooks/think-dsp-digital-signal-processing-in-python
- Christian Tiberius; Max Mulder. *Engineering Signal Analysis: From Fourier to filtering: Theory* (2026). Open Textbook Library: https://open.umn.edu/opentextbooks/textbooks/engineering-signal-analysis-from-fourier-to-filtering-theory
<!-- Hubs: Signal_processing. Portals: PORTAL_Signal_Processing. Signal Processing portal wave 1 · 2026-09-17 · drafted. -->