Skip to content

Linear-phase systems

See why a straight phase keeps a pulse's shape, show that symmetric taps give one, and read the four FIR types and their forced zeros.

Before this12.4 · 3 more
Chapter 17 · Lesson 3 of 4

First, the picture

One pulse through two systems with the same gain and the same average delay. Watch which output is still the pulse.

Straight phase keeps the shape

A 5-sample pulse through z⁻³ (straight phase) and through the all-pass of 17.1 with a = 0.5 (bent phase). Both have gain 1 at every frequency.

The pulse 0.25, 0.75, 1, 0.75, 0.25 is centred at n = 6.

centre, z⁻³
not yet
centre, all-pass
not yet
all-pass dips to
not yet
0.00 / 13.00 s
Describe this picture

A 5-sample pulse through z−3z^{-3} (straight phase) and through the all-pass of 17.1 with a=0.5a = 0.5 (bent phase); both have gain 1 at every frequency. Three stacked panels share the axis sample nn, from 0 to 23: the input x[n]x[n], the pulse, as stems with dot heads; the output through z−3z^{-3}, with square heads; and the output through the all-pass, with diamond heads. The three readouts, the centre through z−3z^{-3}, the centre through the all-pass, and how low the all-pass output dips, read “not yet” until the outputs have been drawn.

At the start the caption says “The pulse 0.25, 0.75, 1, 0.75, 0.25 is centred at n = 6.” The two outputs then build sample by sample. Once they are built, each output panel gets a dashed line labelled “centre”, and the caption says “Both outputs are centred at n = 9: on average both delay by 3 samples. Only z⁻³’s output is the pulse itself.” The readouts are 9.00, 9.00 and −0.19. At the end, faint open circles labelled “input, 3 samples later” appear on both output panels, and the caption says “Moved 3 samples, the input fits z⁻³’s output exactly. The all-pass output dips to −0.19 first and trails a tail: its phase delays slow parts 3 samples and fast ones 0.33, so the pulse comes apart.”

When the clip has finished, a slider named “Pulse width” appears on the input panel, with five stops, 3, 5, 7, 9 and 11 samples, always centred at n=6n=6; its value text reads “5 samples”. Dragging across the input, or the arrow keys (Home gives 3, End gives 11), redraw the outputs at once, and the hint reads “Drag across the input, or use the arrow keys, to change the pulse’s width (3 to 11 samples).” At width 9 the caption says “Width 9: both still centre at 9.00; the all-pass output dips to −0.10. A wider pulse is slower, and its parts are delayed more alike.”

Straight phase keeps the shape

In Frequency response of discrete-time systems (12.4) you found that a straight phase line, ∠H=−Ωn0\angle H=-\Omega n_0, delays every frequency by the same n0n_0 samples. This page shows what that buys you, and how to build it. The answer is a pulse that arrives late but unchanged.

I will use one pulse and two systems. The pulse has the five samples 0.250.25, 0.750.75, 11, 0.750.75, 0.250.25 at n=4n=4 to 88. By centre I mean its balance point, ∑nn y[n]/∑ny[n]\sum_n n\,y[n]\big/\sum_n y[n]. For this pulse the sum of the samples is 3, the sum of n y[n]n\,y[n] is 18, and the centre is 6.

The first system is a delay of three samples, z−3z^{-3}. Its response is e−j3Ωe^{-j3\Omega}, so its gain is 1 at every frequency and its phase is the straight line −3Ω-3\Omega. The second is the first-order all-pass of All-pass systems (17.1), with a=0.5a=0.5:

Hap(z)=−0.5+z−11−0.5z−1.H_\text{ap}(z)=\frac{-0.5+z^{-1}}{1-0.5z^{-1}}.

It also has gain 1 at every frequency. Its group delay is τg=(1−a2)/(1−2acos⁡Ω+a2)\tau_g=(1-a^2)\big/(1-2a\cos\Omega+a^2), which is 3 samples at Ω=0\Omega=0 and falls to 0.330.33 at Ω=π\Omega=\pi.

So the two systems agree on two things: they do not change any size, and they delay a slow signal by 3 samples. Only their phase differs, one straight and one bent. That makes the comparison fair, because only the phase can explain what you see in the picture at the top of this page.

Both outputs are centred at n=9n=9: on average both delay by 3 samples. Moved 3 samples, the input fits z−3z^{-3}‘s output exactly, and only that output is the pulse itself. The all-pass output dips to −0.19-0.19 first and trails a tail: its phase delays slow parts 3 samples and fast ones 0.33, so the pulse comes apart.

Notice that the all-pass output goes below zero at n=4n=4 and n=5n=5, before the delayed pulse could have arrived. The delay’s output only starts at n=7n=7. Afterwards the all-pass output does not stop: from n=12n=12 it halves at every sample, 0.0920.092, 0.0460.046, 0.0230.023, and so on. Both outputs have centre 9.00, so the mean lateness is the same. The shape is not.

When the clip has finished, drag across the input to change the pulse’s width, from 3 to 11 samples. At width 9 both outputs still centre at 9.00, and the all-pass output dips to −0.10-0.10. The dip is −0.25-0.25 at width 3, −0.19-0.19 at 5, −0.14-0.14 at 7, −0.10-0.10 at 9 and −0.07-0.07 at 11. A wide pulse has most of its energy at low frequencies, where the all-pass delay is nearly constant at 3 samples. A narrow pulse reaches higher frequencies, where the delay is shorter, and it is torn apart more.

Think of a marching band crossing a bridge in step. It arrives in formation, a little later. A crowd walking at different paces arrives strung out, even if the average arrival time is the same. A straight phase is the band, and a bent phase is the crowd.

Why symmetric taps give a straight phase

A finite impulse response with NhN_h taps has H(ejΩ)=∑k=0Nh−1h[k]e−jΩkH(e^{j\Omega})=\sum_{k=0}^{N_h-1}h[k]e^{-j\Omega k}. Suppose the taps are symmetric, h[n]=h[Nh−1−n]h[n]=h[N_h-1-n]. This is the reversal x[−n]x[-n] of Shifting, reversing and scaling time (2.1), moved so that it fits the taps: reversing them leaves them unchanged. Their centre is at α=(Nh−1)/2\alpha=(N_h-1)/2.

Write each exponent as k=α+mk=\alpha+m, where mm runs from −α-\alpha to α\alpha. Then h[α+m]=h[α−m]h[\alpha+m]=h[\alpha-m], and each tap and its mirror add up to

h[α+m](e−jΩm+ejΩm)=2h[α+m]cos⁡(mΩ).h[\alpha+m]\left(e^{-j\Omega m}+e^{j\Omega m}\right)=2h[\alpha+m]\cos(m\Omega).

This is Euler’s pair from Complex exponentials & phasors (3.4). After factoring e−jαΩe^{-j\alpha\Omega} out of the whole sum, what remains is a sum of cosines with real weights, so it is real:

H(ejΩ)=e−jαΩHzp(Ω),α=Nh−12.H(e^{j\Omega})=e^{-j\alpha\Omega}H_\text{zp}(\Omega),\qquad \alpha=\frac{N_h-1}{2}.

I call the real factor Hzp(Ω)H_\text{zp}(\Omega) the zero-phase response. The prefix e−jαΩe^{-j\alpha\Omega} is a straight-phase delay of α\alpha samples, so τg=α\tau_g=\alpha at every Ω\Omega. The real factor can change sign. Where it does, the phase jumps by 180°180°, which is a real jump and not an unwrapping artefact (The DTFT, 12.2).

The triangle (1,2,3,2,1)/9(1,2,3,2,1)/9 is the example from Properties of the DTFT (12.3). It has five taps, so α=2\alpha=2, and Hzp=(3+4cos⁡Ω+2cos⁡2Ω)/9H_\text{zp}=(3+4\cos\Omega+2\cos2\Omega)/9. At Ω=0\Omega=0 this is 1, and at Ω=π\Omega=\pi it is 0.1110.111. It never changes sign, so the phase is exactly −2Ω-2\Omega.

A symmetric pulse therefore comes out symmetric. The triangle moves your pulse from centre 6 to centre 8, which is the pulse’s centre plus α=2\alpha=2. Its output rises from 0.0280.028 at n=4n=4 to 0.7220.722 at n=8n=8 and falls through the same values on the way back to 0.0280.028 at n=12n=12. It reads the same in both directions.

Now suppose the taps are antisymmetric, h[n]=−h[Nh−1−n]h[n]=-h[N_h-1-n]. The same pairing gives a difference instead of a sum, e−jΩm−ejΩm=−2jsin⁡(mΩ)e^{-j\Omega m}-e^{j\Omega m}=-2j\sin(m\Omega), the partner of Euler’s pair. So the response is e−jαΩ j Hzp(Ω)e^{-j\alpha\Omega}\,j\,H_\text{zp}(\Omega), with HzpH_\text{zp} real again. Where HzpH_\text{zp} is positive, its angle is

∠H=β−αΩ,β=π2.\angle H=\beta-\alpha\Omega,\qquad \beta=\frac{\pi}{2}.

This is generalised linear phase: a straight line that no longer passes through zero. Its slope is still −α-\alpha, so the group delay is still α\alpha samples at every frequency. The constant β\beta is a quarter turn that adds to every frequency alike.

Four kinds of symmetry, four sets of forced zeros

Symmetric or antisymmetric, odd length or even length: that gives four types. I number them I to IV. Each type, by its symmetry alone, forces zeros of HH at z=1z=1 or z=−1z=-1, and a filter with a zero there has gain 0 at Ω=0\Omega=0 or Ω=π\Omega=\pi, as long as the taps keep their symmetry.

Watch the forced zeros, the ones in a second ring at z=±1z=\pm1, and the gain at the two ends of the band.

Four kinds of symmetry, four sets of forced zeros

Symmetric or antisymmetric taps, odd or even length: the taps, their zeros, and the gain.

Type I, (1, 2, 3, 2, 1)/9: symmetric, odd length. No zero is forced: its zeros sit in pairs at ±120°, and it passes Ω = 0 with gain 1.

type
I: symmetric, odd length
gain at Ω = 0
1.000
gain at Ω = π
0.111
0.00 / 17.00 s
Describe this picture

Symmetric or antisymmetric taps, odd or even length: the taps, their zeros, and the gain, in three panels. The first shows the taps as stems with dot heads, with a dashed line at the centre n=αn=\alpha, labelled “centre”. The second is the plane of zz with the unit circle, the zeros drawn as open circles; where two zeros fall on the same point the label “2 zeros” says so, and a zero that the type forces at z=±1z=\pm1 sits inside a second ring and is labelled “forced”. The third plots the gain ∣H∣\lvert H\rvert against Ω\Omega from 0 to π\pi, with filled squares at Ω=0\Omega=0 and Ω=π\Omega=\pi. The readouts are the type, the gain at Ω=0\Omega = 0 and the gain at Ω=π\Omega = \pi.

The clip steps through the four types, morphing the taps, the zeros and the curve from one to the next, with the caption blank while the morphs run. Type I, (1,2,3,2,1)/9(1, 2, 3, 2, 1)/9 (gains 1.000 and 0.111): “Type I, (1, 2, 3, 2, 1)/9: symmetric, odd length. No zero is forced: its zeros sit in pairs at ±120°, and it passes Ω = 0 with gain 1.” At 5.75 s, type II (1.000 and 0.000): “Type II, (1, 2, 2, 1)/6: symmetric, even length. A zero is forced at z = −1, so the gain at π is always 0: no high-pass of this type.” At 9.75 s, type III (0.000 and 0.000): “Type III, (1, 0, −1)/2: antisymmetric, odd length. Zeros are forced at z = 1 and z = −1: 0 at both ends, so at best a band-pass.” At the end, type IV (0.000 and 1.000): “Type IV, (1, −1)/2: antisymmetric, even length. A zero is forced at z = 1, so it can never pass a constant: good for differentiators, wrong for a low-pass.” When the clip has finished, a four-option switch named “Filter type”, with the options “I”, “II”, “III” and “IV”, appears with the readouts; Left and Right arrows, Home and End move it, and each choice plays the morph and then shows that type’s caption.

Notice that types III and IV give 0 at Ω=0\Omega=0, and types II and III give 0 at Ω=π\Omega=\pi. Type IV is the first difference from Oversampling and noise shaping (11.3), halved: it has gain 0 for a constant, and no filter of this type can do otherwise.

Here is why the zeros are forced. Take a symmetric filter of even length at z=−1z=-1. The tap h[k]h[k] contributes h[k](−1)kh[k](-1)^k and its mirror contributes h[k](−1)Nh−1−kh[k](-1)^{N_h-1-k}. Because Nh−1N_h-1 is odd, the two powers of −1-1 have opposite signs, so every pair cancels and H(−1)=0H(-1)=0. The other cases work alike. At z=1z=1 an antisymmetric filter cancels pair by pair. An antisymmetric filter of odd length also cancels at z=−1z=-1, because its centre tap is 0 and its other pairs cancel.

The group delays follow from α=(Nh−1)/2\alpha=(N_h-1)/2. They are 2, 1.5, 1 and 0.5 samples for the four example filters. An even length delays by a whole number plus a half, which is the price of having no centre tap.

Where do the other zeros go? Every zero of a linear-phase FIR is either on the unit circle or paired with its mirror point 1/zk∗1/z_k^*. This is the flip of Minimum phase (17.2): flipping one zero keeps the gain, but it keeps a symmetric hh symmetric only if the mirror zero is there too. The antisymmetric filter (1,2,−2,−1)(1,2,-2,-1) shows it. Its zeros are 11, −0.382-0.382 and −2.618-2.618, and 0.382=1/2.6180.382=1/2.618.

The SciPy function firwin refuses an even length together with a high-pass, for exactly this reason. A type II filter has a zero at π\pi, so it cannot pass the top of the band. The design pages come in Window-method FIR design (19.1) and Optimal FIR design (19.3).

Worked example

Check the generalised phase of type III, (1,0,−1)/2(1,0,-1)/2, which has α=1\alpha=1 and Hzp=sin⁡ΩH_\text{zp}=\sin\Omega. At Ω=0.25π\Omega=0.25\pi the angle should be 90°−45°=45°90°-45°=45°, and at 0.5π0.5\pi it should be 90°−90°=0°90°-90°=0°. Evaluating the response gives 45°45° and 0°0°. Type IV, (1,−1)/2(1,-1)/2, has α=0.5\alpha=0.5 and Hzp=sin⁡(Ω/2)H_\text{zp}=\sin(\Omega/2). Its angles are 90°−22.5°=67.5°90°-22.5°=67.5° at 0.25π0.25\pi and 90°−45°=45°90°-45°=45° at 0.5π0.5\pi, which the response confirms.

Now go back to the all-pass of the first section. Its group delay is 3 samples at Ω=0\Omega=0, 2.5092.509 at 0.1π0.1\pi, 1.3811.381 at 0.25π0.25\pi and 0.6000.600 at 0.5π0.5\pi. The delay z−3z^{-3} has 3 at all of them. The difference between those two lists is the whole difference between the two outputs, because their gains are both 1.

The pulse widths 3, 5, 7, 9 and 11 give the lowest all-pass samples −0.250-0.250, −0.188-0.188, −0.140-0.140, −0.101-0.101 and −0.075-0.075. The pulse through the triangle keeps its shape, with centre 8.

Where you will meet this

Whenever the shape of a waveform matters, a linear-phase FIR is a common choice, for example for pulses in communications and for edges in images. The price is delay, α\alpha samples, and a long filter has a long delay. Where the shape does not matter, a short IIR filter with a bent phase is cheaper, and Choosing FIR or IIR (20.6) weighs the two. Type III and IV filters give differentiators and Hilbert filters, in Special FIR filters (19.4) and The Hilbert transform and the analytic signal (27.2).

The maths behind it · the exchange matrix

A symmetric hh is a palindromic vector. It is an eigenvector of the exchange matrix, the identity flipped end to end, with eigenvalue 1, and an antisymmetric hh has eigenvalue −1. The four types are the four combinations of that eigenvalue and the parity of the length.

The maths behind it · centred moving averages

A centred moving average of a time series uses symmetric weights, so it smooths without moving peaks and troughs in time. A one-sided (trailing) average lags them. That is linear phase against bent phase in a spreadsheet.

Reference card

QuantityFormulaNotes
Linear phaseH(ejΩ)=e−jαΩHzp(Ω)H(e^{j\Omega})=e^{-j\alpha\Omega}H_\text{zp}(\Omega), HzpH_\text{zp} realτg=α\tau_g=\alpha at every Ω\Omega
Symmetric FIRh[n]=h[Nh−1−n]h[n]=h[N_h-1-n]α=(Nh−1)/2\alpha=(N_h-1)/2
Generalised∠H=β−αΩ\angle H=\beta-\alpha\Omegaantisymmetric: β=π/2\beta=\pi/2
Type Isymmetric, NhN_h oddno forced zero; low-pass, high-pass and band-pass are all possible
Type IIsymmetric, NhN_h evenzero at z=−1z=-1: no high-pass
Type IIIantisymmetric, NhN_h oddzeros at z=±1z=\pm1: band-pass, Hilbert
Type IVantisymmetric, NhN_h evenzero at z=1z=1: no low-pass; differentiators
Zeroson the circle, or in pairs zkz_k, 1/zk∗1/z_k^*17.2’s mirror
Shapeconstant τg\tau_g keeps a waveform’s shapebent phase spreads it

End of lesson 17.3

Where to go next.

Phasorium
LibraryEvery lesson, in order

Parts

About Phasorium
Look