Skip to content

All-pass systems

Put a zero at the mirror point of each pole and the gain stays at 1 for every frequency, while the group delay takes any shape you choose with the pole.

Before this16.4 · 6 more
Chapter 17 · Lesson 1 of 4

First, the picture

A pole sits at 0.5 and a zero at 2, on either side of the unit circle, and a test point walks round the circle. Watch the arrow from each of them to the test point, and the gain the two arrows give.

Twice as far, all the way round

H(z) = (−0.5 + z⁻¹)/(1 − 0.5z⁻¹): pole 0.5, zero 2 = 1/0.5. The gain is 0.5 × (zero's arrow ÷ pole's arrow).

Ω = 0: the zero's arrow is 1.000 and the pole's 0.500. 0.5 × 1.000 ÷ 0.500 = 1.

arrow from the zero
1.000
arrow from the pole
0.500
Ω
0 rad/sample
gain |H|
1.000
0.00 / 12.00 s
Describe this picture

Two panels, the plane and the gain. The plane has the real part across and the imaginary part up, on one scale both ways, so the arrows keep their true lengths. It shows the unit circle, the pole as a cross at 0.5 and the zero as an open circle at 2. A filled dot on the circle is the test point, with a solid arrow to it from the pole and a dashed arrow from the zero, each labelled with its length. The gain panel plots the gain ∣H∣\lvert H\rvert against Ω\Omega from 0 to π\pi rad/sample, traced up to the current Ω\Omega. The readouts are the two arrows’ lengths, Ω\Omega and the gain.

The clip lasts 12 s. The test point starts at Ω=0\Omega=0, where the arrows are 1.000 and 0.500, and walks round; the caption notes that both arrows grow, always in the ratio 2 to 1. At 5 s it holds at Ω=0.5π\Omega=0.5\pi, with arrows of 2.236 and 1.118, and it ends at Ω=π\Omega=\pi, with 3.000 and 1.500. The gain reads 1.000 throughout. When the clip has finished, the test point is a handle named “Test point Ω” that you drag round the upper half of the circle, or move with the arrow keys. At 0.25π0.25\pi the arrows read 1.474 and 0.737.

Twice as far, all the way round

On the page Transfer functions, poles and zeros (16.3) you read a gain from arrows: one from each pole and each zero to the test point ejΩe^{j\Omega} on the unit circle. A pole’s arrow divides the gain and a zero’s arrow multiplies it. A pole near the circle makes a peak, and a zero near it makes a dip. Is there a place for a zero where it cancels the pole’s effect on the gain, for every Ω\Omega at once?

There is, and it is the pole’s mirror image across the circle. For a pole p=rejθp=re^{j\theta}, the mirror point is 1/p∗1/p^*. It has the same angle θ\theta and the reciprocal radius 1/r1/r, as the mirror image z∗z^* of Complex numbers for signals (3.3) keeps the radius and flips the angle. For p=0.5p=0.5 the mirror point is 2.

Take the pole at 0.5 and the zero at 2. Multiply the top and the bottom by zz and factor:

Hap(z)=−0.5+z−11−0.5z−1=−0.5z+1z−0.5=−0.5 z−2z−0.5.\begin{aligned} H_\text{ap}(z)&=\frac{-0.5+z^{-1}}{1-0.5z^{-1}}=\frac{-0.5z+1}{z-0.5}\\ &=-0.5\,\frac{z-2}{z-0.5}. \end{aligned}

On the unit circle the gain is therefore 0.50.5 times the length of the zero’s arrow divided by the length of the pole’s arrow. The claim to check is that, from every point of the circle, the zero at 2 is exactly twice as far away as the pole at 0.5. Then the gain is 0.5×2=10.5\times2=1 at every frequency. Imagine two lamps placed so that wherever you stand on a round path, one lamp is twice as far away as the other.

The picture at the top of the page is this pair of lamps. Notice that both arrows change and their ratio does not. When the clip has finished, drag the test point round the circle yourself, or use the arrow keys.

Now the reason. For a real pole aa, the factor e−jΩ−ae^{-j\Omega}-a is the zero’s arrow turned and scaled, and for a complex pole the same steps work with a∗a^*. Pull out e−jΩe^{-j\Omega}, which has size 1:

∣e−jΩ−a∗∣=∣e−jΩ∣ ∣1−a∗ejΩ∣=∣(1−ae−jΩ)∗∣=∣1−ae−jΩ∣.\begin{aligned} \lvert e^{-j\Omega}-a^*\rvert &= \lvert e^{-j\Omega}\rvert\,\lvert1-a^*e^{j\Omega}\rvert\\ &=\lvert(1-ae^{-j\Omega})^*\rvert\\ &=\lvert1-ae^{-j\Omega}\rvert. \end{aligned}

The last step uses ∣w∗∣=∣w∣\lvert w^*\rvert=\lvert w\rvert from 3.3. So the top and the bottom of Hap(z)=(−a∗+z−1)/(1−az−1)H_\text{ap}(z)=(-a^*+z^{-1})/(1-az^{-1}) have the same size on the circle, and ∣Hap∣=1\lvert H_\text{ap}\rvert=1. A system with this property is called all-pass: it changes no size, only phase. The pole aa must lie inside the circle for the system to be causal and stable, as in Stability and causality (16.4), so its mirror zero lies outside.

The same steps work for a complex pole pp, paired with the zero 1/p∗1/p^*. A real system needs the conjugate pair as well, and then the numerator holds the denominator’s coefficients in reverse order. For p=0.5ejπ/3p=0.5e^{j\pi/3} the denominator is 1−0.5z−1+0.25z−21-0.5z^{-1}+0.25z^{-2} and the numerator is 0.25−0.5z−1+z−20.25-0.5z^{-1}+z^{-2}. Because gains multiply, a cascade of all-pass systems is all-pass too.

The points that are twice as far from 2 as from 0.5 form a circle, known as a circle of Apollonius. Here that circle is the unit circle: ∣z−2∣=2∣z−0.5∣\lvert z-2\rvert=2\lvert z-0.5\rvert reduces to ∣z∣2=1\lvert z\rvert^2=1.

Flat gain, shaped delay

The gain cannot move, but the phase can. Write the real first-order all-pass as Hap=e−jΩD∗/DH_\text{ap}=e^{-j\Omega}D^*/D, with D=1−ae−jΩD=1-ae^{-j\Omega}. This is the same expression as before, since e−jΩD∗=e−jΩ−ae^{-j\Omega}D^*=e^{-j\Omega}-a. The ratio D∗/DD^*/D has size 1 and angle −2∠D-2\angle D, so the phase is

∠Hap=−Ω−2arctan⁡asin⁡Ω1−acos⁡Ω.\angle H_\text{ap}=-\Omega-2\arctan\frac{a\sin\Omega}{1-a\cos\Omega}.

The group delay is minus the slope of this unwrapped phase (12.4, Frequency response of discrete-time systems). The slope of the arctangent is (acos⁡Ω−a2)/(1−2acos⁡Ω+a2)(a\cos\Omega-a^2)/(1-2a\cos\Omega+a^2). Adding it up gives

τg(Ω)=1+2 acos⁡Ω−a21−2acos⁡Ω+a2=1−a21−2acos⁡Ω+a2.\begin{aligned} \tau_g(\Omega)&=1+2\,\frac{a\cos\Omega-a^2}{1-2a\cos\Omega+a^2}\\ &=\frac{1-a^2}{1-2a\cos\Omega+a^2}. \end{aligned}

At Ω=0\Omega=0 this is (1+a)/(1−a)(1+a)/(1-a), and at Ω=π\Omega=\pi it is (1−a)/(1+a)(1-a)/(1+a). With a=0a=0 the pole is at 0, the zero is infinitely far away, and H=z−1H=z^{-1}: a plain delay of one sample at every frequency. With aa near 1 the low frequencies wait much longer than one sample, and the high ones wait a fraction of one. A negative aa does the reverse. I think of a prism: every colour gets through, and each is delayed by its own amount.

Below, the pole moves along the real axis. Notice that the gain line never moves while the delay curve does.

Flat gain, shaped delay

H(z) = (−a + z⁻¹)/(1 − az⁻¹): pole a, zero 1/a. The pole moves along the real axis.

a = 0: the pole sits at 0 and the zero is far away. H = z⁻¹: one sample of delay at every frequency.

pole a
0.00
τ_g at Ω = 0
1.00 samples
τ_g at Ω = π
1.00 samples
0.00 / 15.00 s
Describe this picture

Three panels. The first is a wide strip of the plane, with the unit circle, the pole aa as a cross and the zero 1/a1/a as an open circle; when the zero is too far out for the strip, it becomes an open triangle at the strip’s edge, labelled “zero far away”. The second plots the gain ∣H∣\lvert H\rvert against Ω\Omega in rad/sample: one solid line labelled “|H| = 1”. The third plots the group delay τg\tau_g in samples, from 0 to 10, as a solid curve. The readouts are the pole aa and τg\tau_g at Ω=0\Omega=0 and at Ω=π\Omega=\pi.

The clip lasts 15 s and holds on four values of aa, with a caption at each hold and none between. At a=0a=0 the pole sits at 0 and H=z−1H=z^{-1}: one sample of delay at every frequency, 1.00 at both ends. At 5.5 s, a=0.5a=0.5: 3.00 samples at Ω=0\Omega=0 and 0.33 at π\pi. At 9.5 s, a=0.8a=0.8: 9.00 and 0.11, with a taller and narrower peak. At the end, a=−0.5a=-0.5: the shape flips, 0.33 at low frequencies and 3.00 at the top. When the clip has finished, the pole is a handle named “All-pass pole a”, for any aa from −0.9-0.9 to 0.90.9. The delay axis stays at 0 to 10, so when aa is above about 0.82 the peak is cut off at the top and an open triangle gives its value; at 0.9 it is 19 samples.

When the clip has finished, drag the pole along the real axis yourself, or use the arrow keys.

One fact holds for every aa. At Ω=0\Omega=0 the system gives H=(1−a)/(1−a)=1H=(1-a)/(1-a)=1, and at Ω=π\Omega=\pi it gives H=(−a−1)/(1+a)=−1H=(-a-1)/(1+a)=-1. The phase therefore falls from 00 to −180°-180°, and it falls all the way, because τg\tau_g is positive. The area under the delay curve between 00 and π\pi is π\pi radians’ worth of phase, so the average delay is one sample for every aa. Moving the pole only moves where the delay sits.

Fractional delay

At low frequencies τg(0)=(1+a)/(1−a)\tau_g(0)=(1+a)/(1-a). A delay of dd samples at low frequencies needs d(1−a)=1+ad(1-a)=1+a, so

a=d−1d+1.a=\frac{d-1}{d+1}.

For half a sample, d=0.5d=0.5 gives a=−1/3a=-1/3: the pole at −0.333-0.333 and the zero at −3-3. The group delay is 0.500, 0.562, 0.800, 1.390 and 2.000 samples at Ω=0\Omega=0, 0.25π0.25\pi, 0.5π0.5\pi, 0.75π0.75\pi and π\pi. So the half-sample delay holds only at low frequencies, and it is already 0.8 at 0.5π0.5\pi. A sampled signal has no value between its samples, so this is how a fractional delay is built: not as a shifted copy, but as a system whose delay is close to dd over the band you care about.

Equalising a phase

A phase equaliser is an all-pass placed after a filter. The filter’s group delay is rarely flat. The all-pass adds delay where the filter has little, so the total delay is flatter, and the gain is untouched. Designing one is work for the IIR design pages (20.x).

Echoes with a flat gain

Replace z−1z^{-1} by z−Dz^{-D}, a delay of DD samples, and the same argument gives the Schroeder all-pass of 1962:

H(z)=−a+z−D1−az−D.H(z)=\frac{-a+z^{-D}}{1-az^{-D}}.

On the unit circle e−jDΩe^{-jD\Omega} plays the part of e−jΩe^{-j\Omega}, so the gain is still 1 at every Ω\Omega. The difference equation is y[n]=ay[n−D]−ax[n]+x[n−D]y[n]=ay[n-D]-ax[n]+x[n-D]. Feed it a single impulse. The first output is y[0]=−ay[0]=-a, then y[D]=a⋅(−a)+1=1−a2y[D]=a\cdot(-a)+1=1-a^2, and every output after that is aa times the one DD samples before.

Take D=5D=5 and a=0.7a=0.7. The first stem is −0.7-0.7, then come 0.510.51, 0.3570.357, 0.2500.250, 0.1750.175, 0.1220.122 and 0.0860.086, every 5 samples.

051015202530−0.8−0.400.4−0.70.510.3570.2500.175sample nh[n]
Fig. A Schroeder all-pass with a 5-sample delay: a train of echoes, each 0.7 of the last, yet the gain is exactly 1 at every frequency. Reverberators chain several of these to thicken the echoes without colouring the sound.

The total energy of the stems is a2+(1−a2)2(1+a2+a4+⋯ )=a2+(1−a2)=1a^2+(1-a^2)^2(1+a^2+a^4+\cdots)=a^2+(1-a^2)=1, the same as the energy of the impulse that went in. Every echo is smaller than the one before, but the echoes together carry all of the impulse’s energy.

Worked example

Check the gain of HapH_\text{ap} with a=0.5a=0.5 by hand at Ω=0.25π\Omega=0.25\pi, where cos⁡Ω=0.7071\cos\Omega=0.7071. The pole’s arrow has length 1−2(0.5)(0.7071)+0.25=0.5429=0.737\sqrt{1-2(0.5)(0.7071)+0.25}=\sqrt{0.5429}=0.737. The zero’s arrow has length 1−2(2)(0.7071)+4=2.1716=1.474\sqrt{1-2(2)(0.7071)+4}=\sqrt{2.1716}=1.474. Their ratio is 2, so the gain is 0.5×2=10.5\times2=1.

For the delay, a=0.5a=0.5 at Ω=0.5π\Omega=0.5\pi has cos⁡Ω=0\cos\Omega=0, so τg=(1−0.25)/(1+0.25)=0.6\tau_g=(1-0.25)/(1+0.25)=0.6 samples. For a=0.8a=0.8 at Ω=0\Omega=0, τg=0.36/0.04=9\tau_g=0.36/0.04=9 samples.

Now design for a quarter of a sample, d=0.25d=0.25. Then a=(0.25−1)/(0.25+1)=−0.6a=(0.25-1)/(0.25+1)=-0.6, with the pole at −0.6-0.6 and the zero at −1/0.6=−1.667-1/0.6=-1.667. Check the ends: τg(0)=(1−0.6)/(1+0.6)=0.25\tau_g(0)=(1-0.6)/(1+0.6)=0.25 and τg(π)=(1+0.6)/(1−0.6)=4\tau_g(\pi)=(1+0.6)/(1-0.6)=4. In between, τg\tau_g is 0.290, 0.471 and 1.251 samples at 0.25π0.25\pi, 0.5π0.5\pi and 0.75π0.75\pi. So the delay is a quarter of a sample only near Ω=0\Omega=0, and it has nearly doubled by 0.5π0.5\pi.

Where you will meet this

A phase equaliser corrects the phase of a loudspeaker crossover or an anti-aliasing filter. A fractional delay lines up two sampled signals that arrived a fraction of a sample apart, as described in Laakso et al., “Splitting the unit delay”, IEEE Signal Processing Magazine, 1996, and it is the building block of Resampling by any factor (22.3). The Schroeder all-pass is a part of artificial reverberation, which returns in Audio effects (29.2).

Next, Minimum phase (17.2) splits any stable system into a part that has the smallest delay and an all-pass. Linear-phase systems (17.3) take the opposite goal: a delay that is the same at every frequency.

The maths behind it · unitary matrices

An all-pass keeps every frequency’s size, so it keeps a signal’s energy. Applied to a block of NN samples through the DFT, it multiplies each DFT value by a number of size 1. That is a unitary matrix (see The DFT as a matrix, 13.5): a rotation that changes the coordinates but never a length.

The maths behind it · white noise and correlation

White noise through an all-pass is still white: its power spectrum is multiplied by ∣H∣2=1\lvert H\rvert^2=1. The output samples are uncorrelated, yet they are not the same samples in a new order. Correlation (24.3) sees nothing, though the phase has changed.

Reference card

QuantityFormulaNotes
Mirror point across the circlep → 1/p∗p\ \to\ 1/p^*same angle, reciprocal radius
First-order all-passHap(z)=−a∗+z−11−az−1H_\text{ap}(z)=\dfrac{-a^*+z^{-1}}{1-az^{-1}}pole aa, zero 1/a∗1/a^*; ∣H∣=1\lvert H\rvert=1
Why flat∣e−jΩ−a∗∣=∣1−ae−jΩ∣\lvert e^{-j\Omega}-a^*\rvert=\lvert1-ae^{-j\Omega}\rverttop and bottom the same size
Group delay (real aa)τg(Ω)=1−a21−2acos⁡Ω+a2\tau_g(\Omega)=\dfrac{1-a^2}{1-2a\cos\Omega+a^2}1+a1−a\dfrac{1+a}{1-a} at 0; 1−a1+a\dfrac{1-a}{1+a} at π\pi
Phase at π\pi−π-\pi for every aathe delay curve’s area is fixed
Fractional delay dda=d−1d+1a=\dfrac{d-1}{d+1}low frequencies
Cascadeproduct of all-passes is all-passphase equalisers
Schroeder all-pass−a+z−D1−az−D\dfrac{-a+z^{-D}}{1-az^{-D}}echoes every DD, flat gain

End of lesson 17.1

Where to go next.

Phasorium
LibraryEvery lesson, in order

Parts

About Phasorium
Look