DSPRelated.com

All-Pass Filter

Category: Filters | Also known as: all-pass

An all-pass filter is a filter that passes all frequency components of a signal with (ideally) equal gain while introducing a frequency-dependent phase shift. It is used to alter the phase spectrum of a signal without affecting its magnitude spectrum.

In practice

All-pass filters appear frequently in embedded DSP pipelines where phase relationships between signals matter but the amplitude response must be left untouched. Common applications include group-delay equalization (compensating for the non-linear phase response of other filters, such as IIR lowpass or bandpass stages), time-alignment of audio channels, and single-sideband or phasing-method implementations in software-defined radio. Because they do not change the magnitude spectrum, they are transparent to any downstream stage that only examines amplitude -- though they can still affect time-domain behavior, delay, and any processing that depends on phase or transient shape.

In discrete-time implementations, one common first-order IIR all-pass section has the transfer function H(z) = (a + z^-1) / (1 + a*z^-1), where the coefficient 'a' controls the frequency at which the phase shift reaches -90 degrees (the exact relationship depends on the sample rate and normalization convention used). Other sign-flipped or reciprocal parameterizations appear in the literature and are equivalent in structure. Higher-order all-pass filters are typically built by cascading first- and second-order sections. This IIR structure is computationally inexpensive: a single first-order section requires only one multiply and two adds per sample on most fixed-point or floating-point DSP cores.

A practical pitfall on fixed-point MCUs (for example, Cortex-M4F or DSP56000-class devices) is coefficient quantization. The all-pass property relies on an exact mirror-image numerator/denominator relationship; rounding the coefficient 'a' to a finite word length breaks the symmetry and introduces small but nonzero magnitude ripple. Using Q15 or Q31 arithmetic and verifying the magnitude response on the actual target hardware -- rather than relying solely on floating-point simulation -- is advisable. The blog post "An Astounding Digital Filter Design Application" demonstrates tools that can help validate filter designs before committing to a fixed-point implementation.

All-pass sections also appear as building blocks inside more complex structures. A two-path polyphase decomposition of a half-band filter, for instance, uses two all-pass subfilters, which halves the multiply rate compared to a direct-form implementation. This is a useful optimization on resource-constrained MCUs, as discussed in the context of efficient filter structures in "Reducing IIR Filter Computational Workload."

Discussed on DSPRelated

Frequently asked

If an all-pass filter does not change the magnitude, why would I use one?
Phase matters whenever two or more signal paths are combined, or when the shape of a waveform in the time domain is important. Group-delay equalization is a typical reason: an IIR anti-aliasing or reconstruction filter introduces non-constant group delay, which smears transients. Cascading an all-pass equalizer after that filter can flatten the group delay across the passband without disturbing the amplitude response.
How does a first-order all-pass differ from a second-order all-pass?
A first-order section contributes a phase shift that ranges from 0 to -180 degrees across the full frequency band (0 to Nyquist), passing through approximately -90 degrees at the design frequency (subject to sign convention and parameterization). A second-order section contributes 0 to -360 degrees of phase shift and can be tuned with both a center frequency and a Q factor (or bandwidth), making it useful for equalizing the phase bump associated with a resonant filter stage. In practice, complex group-delay correction usually requires a cascade of second-order sections.
Can an all-pass filter be implemented as an FIR filter?
An FIR filter with a flat magnitude response is technically all-pass in the magnitude sense and, if designed with linear phase, also delivers constant group delay -- but achieving useful phase shaping with an FIR structure requires a high filter order and corresponding latency. Note that linear phase alone does not make an FIR filter all-pass; the flat magnitude condition must also hold. IIR all-pass sections are far more common for phase equalization because they achieve the required phase profile with very few coefficients and low latency, which matters on MCUs with limited cycles and in real-time control or audio systems.
Does an all-pass filter have perfectly flat magnitude in a real fixed-point implementation?
Not exactly. The all-pass property depends on the numerator polynomial being the reverse of the denominator polynomial with matching coefficient values. On fixed-point hardware, quantizing the coefficient 'a' to a finite word length (say, 16-bit Q15) breaks this symmetry and introduces small magnitude deviations. The deviations are typically small for gentle phase responses but should be measured on the target hardware, especially for audio or precision measurement applications.
What is the relationship between all-pass filters and polyphase filter banks?
Certain efficient half-band and related decimation/interpolation filters can be decomposed into two polyphase branches, each of which is a cascade of first- or second-order all-pass sections. This structure cuts the required multiply-accumulate operations roughly in half compared to a direct-form implementation of the same filter, because each all-pass section needs only one unique coefficient. This efficiency gain is relevant on MCUs without a hardware FPU or with limited MAC throughput.

Differentiators vs similar concepts

An all-pass filter is frequently confused with a "transparent" or "bypass" signal path (which applies no processing at all). The distinction is that an all-pass filter actively modifies the signal's phase, which has real consequences for waveform shape and for the constructive/destructive interference that occurs when the filtered signal is combined with another path. It is also distinct from a notch or band-reject filter: a notch filter attenuates a specific frequency band in the magnitude response, whereas an all-pass filter leaves magnitude untouched entirely. All-pass filters are sometimes confused with allpass sections used inside wave-digital or lattice filter structures, where "all-pass" refers to the same property but the implementation topology differs from the standard direct-form IIR.