Skip to content

Transfer functions, poles & zeros

Read a transfer function off a difference equation, find its poles and zeros, and see how they set ringing, decay and the size of the frequency response.

Before this12.4 · 16.2 · 5 more
Chapter 16 · Lesson 3 of 5

First, the picture

Two poles in the plane of zz, and the impulse response they make. Watch what turning the pair does to the ringing, and what pulling it in does.

Where the pair sits is how h[n] moves

Poles re^{±jθ} of y[n] = 2r cos θ y[n−1] − r²y[n−2] + x[n], and its impulse response.

r = 0.9, θ = 30°: each sample h turns 30° and shrinks to 0.9 of its size. It rings once every 12 samples and takes 37 samples to fall to 2 %.

pole
0.90∠30.0°
samples per cycle
12.0
rⁿ falls to 2 % at
n = 37.1
0.00 / 14.00 s
Describe this picture

Poles re±jθre^{\pm j\theta} of y[n]=2rcos⁡θ y[n−1]−r2y[n−2]+x[n]y[n] = 2r\cos\theta\,y[n-1] - r^2y[n-2] + x[n], and its impulse response. Two panels: the plane, real part against imaginary part, with the unit circle labelled “unit circle”, and the stems of h[n]h[n] against sample nn from 0 to 24. A cross marks the upper pole, labelled “re^{jθ}”; its mirror, labelled “re^{−jθ}”, has its own colour. A dashed circle of radius rr passes through both poles, an arc labelled “θ” measures the angle from the real axis, and a circle at 0 is labelled “2 zeros”. The dashed curve labelled “envelope” is ±rn/sin⁡θ\pm r^n/\sin\theta, and the key row names “h[n]” and “envelope”. Three readouts follow the frame: the pole, in a form like “0.90∠30.0°”, the samples per cycle, and when rnr^n falls to 2 %, in a form like “n = 37.1”.

The clip starts at r=0.9r=0.9 and θ=30°\theta=30° (0.90∠30.0°, 12.0, n = 37.1): “r = 0.9, θ = 30°: each sample h turns 30° and shrinks to 0.9 of its size. It rings once every 12 samples and takes 37 samples to fall to 2 %.” The angle then eases to 90°, with the caption “Turning the pair: the ringing speeds up.”; at the hold (0.90∠90.0°, 4.0, n = 37.1): “Turn the pair to θ = 90°: now a cycle takes 4 samples. The radius did not change, so it dies just as slowly.” Last, the radius eases to 0.6, with the caption “Pulling the pair in: the ringing dies sooner.”; at the end (0.60∠90.0°, 4.0, n = 7.7): “Pull it in to r = 0.6: the same 4-sample ringing, gone within 8 samples. The angle sets the ringing; the radius sets how fast it dies.”

When the clip has finished, the upper pole becomes a handle named “Pole pair”, whose value text reads like “0.60∠90.0°, 4.0 samples per cycle”. The hint reads “Drag the upper pole, or use the arrow keys, to move the pair. The mirror pole follows.” Left and Right change θ\theta by 5°, and Up and Down change rr by 0.01; rr runs from 0.3 to 0.95 and θ\theta from 15° to 165°. After a drag, the caption at a key position is the one above; elsewhere it reads in the form “Pole 0.80∠45.0°: a cycle every 8.0 samples, down to 2 % by n = 17.5.”

From a difference equation to a transfer function

The z-transform (16.1) turned a sequence into a function of zz, and Properties and the inverse z-transform (16.2) gave the delay rule: a delay by one sample multiplies the transform by z−1z^{-1}. This page uses that rule to read a system’s behaviour from one picture, the discrete twin of Poles, zeros and the s-plane (9.3).

Take a system with impulse response h[n]h[n]. Its z-transform H(z)H(z) is the transfer function. Convolution becomes a product, so Y(z)=H(z)X(z)Y(z)=H(z)X(z) and H(z)=Y(z)/X(z)H(z)=Y(z)/X(z). You do not need hh to find it. Transform each term of the difference equation from Difference equations (6.1), turning every delay into z−1z^{-1}, and divide:

H(z)=Y(z)X(z)=∑kbkz−k∑kakz−k,a0=1.\begin{aligned} H(z)&=\frac{Y(z)}{X(z)}=\frac{\sum_k b_k z^{-k}}{\sum_k a_k z^{-k}},\\ a_0&=1. \end{aligned}

The coefficients bkb_k and aka_k are the ones SciPy’s lfilter(b, a, x) takes. On the unit circle, z=ejΩz=e^{j\Omega}, this is the frequency response of Frequency response of discrete-time systems (12.4), H(ejΩ)H(e^{j\Omega}).

Here is the equation from 6.1:

y[n]=x[n]+2x[n−1]+0.5 y[n−1].\begin{aligned} y[n]={}&x[n]+2x[n-1]\\ &+0.5\,y[n-1]. \end{aligned}

The input side has b0=1b_0=1 and b1=2b_1=2. The output side moves to the left as a1=−0.5a_1=-0.5. So H(z)=1+2z−11−0.5z−1H(z)=\dfrac{1+2z^{-1}}{1-0.5z^{-1}}.

Now multiply the top and bottom by the highest power of zz that appears. The zeros zkz_k are the roots of the top: the values of zz where HH is 0. The poles pkp_k are the roots of the bottom: the values where HH blows up. With a constant KK for the overall size,

H(z)=K ∏k(1−zkz−1)∏k(1−pkz−1).H(z)=K\,\frac{\prod_k (1-z_k z^{-1})}{\prod_k (1-p_k z^{-1})}.

When b0b_0 is not 0, K=b0K=b_0. SciPy’s z, p, k = tf2zpk(b, a) returns the three at once. For this system the top is z+2z+2 and the bottom is z−0.5z-0.5, so there is one zero at −2-2, one pole at 0.50.5 and K=1K=1. To go back, multiply the factors out.

difference equation

y[n] = x[n] + 2x[n−1] + 0.5y[n−1]

transfer function

H(z) = (1 + 2z⁻¹)/(1 − 0.5z⁻¹)

real partimaginary partzero −2pole 0.5unit circle
Fig. 6.1’s equation, its transfer function, and its plane: a zero at −2 and a pole at 0.5. The pole is the 0.5 in the loop; h[n] contains 0.5ⁿ.

The pole is the 0.5 in the loop, and it is also what hh contains. By the rule from 16.2, a pole at z=az=a puts the term ana^n into h[n]h[n]. Here h[0]=1h[0]=1 and h[n]=5 (0.5)nh[n]=5\,(0.5)^n for n≥1n\ge1, so h[1]=2.5h[1]=2.5 and h[2]=1.25h[2]=1.25.

Order 2 works the same way, by hand, with the quadratic formula. The bottom 1−1.2728z−1+0.81z−21-1.2728z^{-1}+0.81z^{-2} becomes z2−1.2728z+0.81z^2-1.2728z+0.81. Its discriminant is 1.27282−4(0.81)=−1.621.2728^2-4(0.81)=-1.62, so the roots are complex: z=0.6364±0.6364jz=0.6364\pm0.6364j. Complex roots of a real polynomial come as mirror pairs, as in 9.3.

Where the pair sits is how h[n] moves

In 6.3 I wrote the recursion of a ringing system with a pole pair at angle Ω\Omega. Here I write the angle θ\theta, because Ω\Omega now means the frequency of a test point on the circle. The recursion is

y[n]=2rcos⁡θ y[n−1]−r2 y[n−2]+x[n],\begin{aligned} y[n]={}&2r\cos\theta\,y[n-1]\\ &-r^2\,y[n-2]+x[n], \end{aligned}

and its transfer function is H(z)=11−2rcos⁡θ z−1+r2z−2H(z)=\dfrac{1}{1-2r\cos\theta\,z^{-1}+r^2z^{-2}}. The bottom factors as (1−rejθz−1)(1−re−jθz−1)(1-re^{j\theta}z^{-1})(1-re^{-j\theta}z^{-1}), so the poles are re±jθre^{\pm j\theta}. Multiplying the top and bottom by z2z^2 shows two zeros at z=0z=0.

The impulse response is h[n]=rnsin⁡((n+1)θ)sin⁡θh[n]=r^n\dfrac{\sin((n+1)\theta)}{\sin\theta}. Each sample it turns by θ\theta and shrinks by rr: the spiral of 6.3. A plucked string is the everyday case. Its pitch is the angle, and how long it sounds is the radius.

The picture at the top of this page moves such a pair. At r=0.9r=0.9 and θ=30°\theta=30°, each sample hh turns 30° and shrinks to 0.9 of its size: it rings once every 12 samples and takes 37 samples to fall to 2 %. Turned to θ=90°\theta=90°, a cycle takes 4 samples. The radius did not change, so it dies just as slowly. Pulled in to r=0.6r=0.6, the same 4-sample ringing is gone within 8 samples. The angle sets the ringing; the radius sets how fast it dies.

Notice what each move changed. Turning the pair changed only how fast the response rings. Pulling it in changed only how fast it dies.

When the clip has finished, drag the upper pole to move the pair yourself; the mirror pole follows.

Here are the numbers behind the three key frames. For (r,θ)=(0.9,30°)(r,\theta)=(0.9,30°) the bottom is 1−1.5588z−1+0.81z−21-1.5588z^{-1}+0.81z^{-2}, and the first eight values of hh are 1, 1.5588, 1.62, 1.2627, 0.6561, 0, −0.5314 and −0.8284, the numbers of 6.3. A cycle takes 360°/30°=12360°/30°=12 samples. The envelope 0.9n0.9^n falls to 2 % when 0.9n=0.020.9^n=0.02, so n=ln⁡50/(−ln⁡0.9)=37.13n=\ln50/(-\ln0.9)=37.13. At (0.9,90°)(0.9,90°) the bottom is 1+0.81z−21+0.81z^{-2}, and hh is 1, 0, −0.81, 0, 0.6561 and so on: four samples per cycle. At (0.6,90°)(0.6,90°) it is 1, 0, −0.36, 0, 0.1296 and the 2 % time is n=7.66n=7.66. The pair (0.8,45°)(0.8,45°) rings every 8 samples and reaches 2 % at n=17.53n=17.53.

A single real pole aa gives ana^n. A negative pole flips sign every sample, which is θ=180°\theta=180°. The pole angle also has a frequency in hertz. A sample at rate fsf_s is 1/fs1/f_s seconds long, and one turn of 2π2\pi rad takes 2π/θ2\pi/\theta samples, so

f=θfs2π.f=\frac{\theta f_s}{2\pi}.

At fs=8f_s=8 kHz a pole angle of θ=90°\theta=90° rings at 2 kHz.

A pole close to the unit circle rings for a long time, nearly a steady tone. What happens on the circle, and beyond it, is the question of Stability and causality (16.4).

Arrows to the unit circle

Now the frequency response. At the test point z=ejΩz=e^{j\Omega}, each factor (z−p)(z-p) is the arrow from the pole pp to the test point, by the nose-to-tail rule of Complex numbers for signals (3.3). Dividing complex numbers divides lengths, as in Fourier series and LTI systems (7.4). This is the rule of 9.3 with the spin-rate axis bent into a circle.

Take a resonator with poles 0.9e±jπ/40.9e^{\pm j\pi/4}. Choose the gain KK so that ∣H∣=1\lvert H\rvert=1 at Ω=0\Omega=0. At z=1z=1 the bottom is 1−2(0.9)cos⁡(π/4)+0.81=0.5371-2(0.9)\cos(\pi/4)+0.81=0.537, so K=0.537K=0.537, and

H(z)=K z2(z−p)(z−p∗).H(z)=K\,\frac{z^2}{(z-p)(z-p^*)}.

On the circle, the size is

∣H(ejΩ)∣=K∣ejΩ−p∣ ∣ejΩ−p∗∣.\lvert H(e^{j\Omega})\rvert=\frac{K}{\lvert e^{j\Omega}-p\rvert\,\lvert e^{j\Omega}-p^*\rvert}.

The two zeros at 0 are 1 away from every point of the circle, since ∣ejΩ−0∣=1\lvert e^{j\Omega}-0\rvert=1. They change no size. SciPy sees them if you write the top as [K, 0, 0].

Watch the arrow to the upper pole as the test point walks round the circle: where it is shortest, the gain climbs.

Arrows to the unit circle

H(z) = 0.537/(1 − 1.273z⁻¹ + 0.81z⁻²), poles 0.9e^{±jπ/4}. The gain is 0.537 ÷ (product of the arrow lengths).

Ω = 0: both arrows are 0.733 long, so |H| = 0.537 ÷ (0.733 × 0.733) = 1.00.

test point Ω
0 rad/sample
gain |H|
1.00
0.00 / 13.00 s
Describe this picture

H(z)=0.537/(1−1.273z−1+0.81z−2)H(z) = 0.537/(1 - 1.273z^{-1} + 0.81z^{-2}), with poles 0.9e±jπ/40.9e^{\pm j\pi/4}; the gain is 0.537 ÷ (product of the arrow lengths). The plane shows the unit circle, the two poles labelled “0.9∠45°” and “0.9∠−45°”, a circle at 0 labelled “2 zeros”, and a filled dot, the test point, on the circle. An arrow runs from each pole to the test point, “to the upper pole” solid and “to the mirror pole” dashed, each with its length to three decimals. The gain panel plots gain ∣H∣\lvert H\rvert from 0 to 4.5 against Ω\Omega in rad/sample from 0 to π\pi, with the curve traced up to the current point. Two readouts sit in one row: the test point Ω\Omega, in a form like “0.25π rad/sample”, and the gain ∣H∣\lvert H\rvert.

At the start, Ω=0\Omega=0 (0 rad/sample, 1.00): “Ω = 0: both arrows are 0.733 long, so |H| = 0.537 ÷ (0.733 × 0.733) = 1.00.” The test point then eases toward the upper pole: “The test point nears the upper pole: its arrow shortens, and |H| climbs.” At the hold, Ω=0.25π\Omega=0.25\pi, the poles’ angle (0.25π rad/sample, 3.99): “Ω = 0.25π, the poles’ angle: the short arrow is 0.100, just 1 − r, and |H| = 3.99, near its peak.” Then: “Past the pole both arrows grow, and |H| falls.” At the end, Ω=π\Omega=\pi (1.00π rad/sample, 0.17): “Ω = π: both arrows are 1.756 long, and |H| = 0.17. The gain is high only where the walk passes close to a pole.”

When the clip has finished, the test point is a handle named “Test point Ω”, whose value text reads like “0.50π rad/sample, |H| = 0.42”. It moves along the upper half of the circle, from 0 to π\pi in steps of 0.01π0.01\pi, and the hint reads “Drag the test point round the circle, or use the arrow keys (0 to π).” After a drag, the caption reads in the form “Ω = 0.50π: arrows 0.733 and 1.756, |H| = 0.42.”

At Ω=0\Omega=0 both arrows are 0.733 long, so ∣H∣=0.537÷(0.733×0.733)=1.00\lvert H\rvert=0.537\div(0.733\times0.733)=1.00. As the test point nears the upper pole, its arrow shortens and ∣H∣\lvert H\rvert climbs. At Ω=0.25π\Omega=0.25\pi, the poles’ angle, the short arrow is just 1−r=0.1001-r=0.100 long, and ∣H∣=3.99\lvert H\rvert=3.99, near its peak. Past the pole both arrows grow, and ∣H∣\lvert H\rvert falls. At Ω=π\Omega=\pi both arrows are 1.756 long, and ∣H∣=0.17\lvert H\rvert=0.17. The gain is high only where the walk passes close to a pole.

When the clip has finished, drag the test point round the circle to read the gain anywhere.

The gain numbers at the other test points, for K=0.5372K=0.5372: at 0.125π0.125\pi the arrows are 0.3834 and 1.0589, and ∣H∣=1.3232\lvert H\rvert=1.3232. At 0.5π0.5\pi they are 0.7329 and 1.7558, and ∣H∣=0.4174\lvert H\rvert=0.4174. At 0.75π0.75\pi they are 1.3454 and 1.9000, and ∣H∣=0.2102\lvert H\rvert=0.2102. At π\pi, ∣H∣=0.1743\lvert H\rvert=0.1743, which is −15.18-15.18 dB.

The true peak, 4.00, is not at the pole’s angle. It is at Ω=0.248π\Omega=0.248\pi, a little before it, because the arrow to the mirror pole is still growing as you walk. This is the point of 9.3 §3 again. The peak is at arccos⁡ ⁣(1+r22rcos⁡θ)\arccos\!\big(\tfrac{1+r^2}{2r}\cos\theta\big), which is 0.2482π0.2482\pi here, and freqz gives the same. The half-power band, where ∣H∣\lvert H\rvert is at least the peak divided by 2\sqrt2, runs from 0.212π0.212\pi to 0.280π0.280\pi. Its width is 0.2140.214 rad/sample, close to 2(1−r)=0.22(1-r)=0.2. Resonators, notches and combs (17.4) uses that rule.

The angle of HH follows the same picture: the angles of the zero arrows minus the angles of the pole arrows. The two zeros at 0 each have arrow angle Ω\Omega, so they add 2Ω2\Omega. At Ω=π/4\Omega=\pi/4 the arrow to the upper pole points at 45.00°45.00° and the arrow to the mirror pole at 86.99°86.99°. So

∠H=2(45°)−45.00°−86.99°=−41.99°.\begin{aligned} \angle H&=2(45°)-45.00°-86.99°\\ &=-41.99°. \end{aligned}

A zero on the circle makes a zero arrow of length 0, so ∣H∣=0\lvert H\rvert=0 there. That is the notch of 17.4.

The maths behind it · characteristic polynomials

The bottom polynomial 1+a1z−1+a2z−21+a_1z^{-1}+a_2z^{-2} is the characteristic polynomial of the recursion’s 2×2 state matrix, and the poles are its eigenvalues. A real matrix has complex eigenvalues only in mirror pairs, which is why the poles of a real system pair up.

The maths behind it · autoregressive spectra

An autoregressive model of a random series, y[n]=−a1y[n−1]−a2y[n−2]+(noise)y[n]=-a_1y[n-1]-a_2y[n-2]+(\text{noise}), has these poles. A pair close to the unit circle gives the series’ spectrum a sharp peak at the pole’s angle: this lesson’s walk, fed with noise.

Worked example

Go the other way: from poles to an equation. Place a pair at 0.95e±jπ/40.95e^{\pm j\pi/4}. The bottom is 1−2(0.95)cos⁡(π/4)z−1+0.952z−21-2(0.95)\cos(\pi/4)z^{-1}+0.95^2z^{-2}. Here 2(0.95)cos⁡(π/4)=1.34352(0.95)\cos(\pi/4)=1.3435 and 0.952=0.90250.95^2=0.9025, so

y[n]=1.3435 y[n−1]−0.9025 y[n−2]+x[n].\begin{aligned} y[n]={}&1.3435\,y[n-1]\\ &-0.9025\,y[n-2]+x[n]. \end{aligned}

The peak of its gain sits near θ=π/4\theta=\pi/4, which is fs/8f_s/8 in hertz. At fs=8f_s=8 kHz that is 1 kHz. The pair is closer to the circle than the pair of 0.9, so the peak is narrower: its width is about 2(1−0.95)=0.12(1-0.95)=0.1 rad/sample.

Where you will meet this

Every digital filter is a transfer function, and its design is a placement of poles and zeros: a pole near the circle for a peak, a zero on it for a notch. The same placement builds the resonators and combs of Resonators, notches and combs (17.4). All-pass systems (17.1) and Minimum phase (17.2) read the phase and the size from the same plane.

Reference card

QuantityFormulaNotes
Transfer functionH(z)=Y(z)X(z)=∑kbkz−k∑kakz−kH(z)=\dfrac{Y(z)}{X(z)}=\dfrac{\sum_kb_kz^{-k}}{\sum_ka_kz^{-k}}, a0=1a_0=1the z-transform of h[n]h[n]
FactoredH(z)=K∏(1−zkz−1)∏(1−pkz−1)H(z)=K\dfrac{\prod(1-z_kz^{-1})}{\prod(1-p_kz^{-1})}SciPy z, p, k = tf2zpk(b, a); K=b0K=b_0
Frequency responseH(ejΩ)=H(z)H(e^{j\Omega})=H(z) at z=ejΩz=e^{j\Omega}freqz(b, a)
Pole pair re±jθre^{\pm j\theta}h[n]=rnsin⁡((n+1)θ)sin⁡θh[n]=r^n\dfrac{\sin((n+1)\theta)}{\sin\theta} for 1/(1−2rcos⁡θ z−1+r2z−2)1/(1-2r\cos\theta\,z^{-1}+r^2z^{-2})rings every 360°/θ360°/\theta samples; envelope rnr^n
Pole angle in hertzf=θfs/2πf=\theta f_s/2\piθ=π/2\theta=\pi/2 at 8 kHz: 2 kHz
Gain from arrows∣H(ejΩ)∣=∣K∣∏∣ejΩ−zk∣∏∣ejΩ−pk∣\lvert H(e^{j\Omega})\rvert=\lvert K\rvert\dfrac{\prod\lvert e^{j\Omega}-z_k\rvert}{\prod\lvert e^{j\Omega}-p_k\rvert}zeros at 0 change no size
Phase from arrowszero-arrow angles minus pole-arrow anglesplus Ω\Omega per extra zero at 0
Resonator peaknear the pole’s angle; width about 2(1−r)2(1-r) rad/sample17.4

End of lesson 16.3

Where to go next.

Phasorium
LibraryEvery lesson, in order

Parts

About Phasorium
Look