Poles, Zeros and Stability
A rational transfer function is determined (up to a gain) by its zeros, where , and its poles, where blows up. Plotting them in the complex plane tells you at a glance whether a filter is stable, what kind of filter it is, and roughly what its frequency response looks like. It is the main design tool for IIR filters.
Factoring the transfer function
with zeros and poles . For real coefficients they come in conjugate pairs.
Stability: a causal system is stable exactly when all poles lie strictly inside the unit circle. Each pole contributes a term to the impulse response, which decays only if .
import numpy as np
def poles_zeros(b, a):
return np.roots(b), np.roots(a) # roots of polynomials in z (coefficients of z^0, z^-1, ...)
filters = {
"one-pole low-pass": ([0.1], [1, -0.9]),
"notch at 50 Hz/500 Hz": ([1, -2 * np.cos(0.2 * np.pi), 1], [1, -2 * 0.98 * np.cos(0.2 * np.pi), 0.98 ** 2]),
"resonator r = 1.02": ([1], [1, -2 * 1.02 * np.cos(0.3), 1.02 ** 2]),
}
for name, (b, a) in filters.items():
z, p = poles_zeros(b, a)
print(f"{name}:")
print(" zeros |q|:", (np.round(np.abs(z), 4)).tolist(), " poles |p|:", np.round(np.abs(p), 4).tolist(),
" stable:", bool(np.all(np.abs(p) < 1)))one-pole low-pass:
zeros |q|: [] poles |p|: [0.9] stable: True
notch at 50 Hz/500 Hz:
zeros |q|: [1.0, 1.0] poles |p|: [0.98, 0.98] stable: True
resonator r = 1.02:
zeros |q|: [] poles |p|: [1.02, 1.02] stable: False
The resonator with poles at radius 1.02 is unstable: its impulse response grows by 2 % per sample.
Reading the frequency response geometrically
At frequency , the point moves around the unit circle. The gain is times the product of distances to the zeros divided by the product of distances to the poles:
- A zero on the circle makes the gain exactly 0 at that frequency (a notch).
- A pole close to the circle makes the gain large near that frequency (a resonance), and the closer it is, the sharper the peak.
import numpy as np
for r in (0.5, 0.9, 0.99):
theta = np.pi / 4 # resonance at a quarter of the sampling rate / 2
a = [1, -2 * r * np.cos(theta), r * r]
w = np.linspace(0, np.pi, 4001)
z = np.exp(1j * w)
H = 1 / (a[0] + a[1] / z + a[2] / z ** 2)
G = np.abs(H) / np.abs(H).max()
bw = (w[G >= 1 / np.sqrt(2)].max() - w[G >= 1 / np.sqrt(2)].min()) / np.pi
print(f"pole radius {r}: peak at omega = {w[np.argmax(np.abs(H))] / np.pi:.3f} pi, peak gain {np.abs(H).max():8.2f}, -3 dB bandwidth {bw:.4f} pi")pole radius 0.5: peak at omega = 0.155 pi, peak gain 1.89, -3 dB bandwidth 0.3848 pi
pole radius 0.9: peak at omega = 0.248 pi, peak gain 7.44, -3 dB bandwidth 0.0678 pi
pole radius 0.99: peak at omega = 0.250 pi, peak gain 71.07, -3 dB bandwidth 0.0060 pi
As the poles approach the circle, the peak sharpens: the bandwidth is about radians. This is how a single biquad makes a narrow band-pass or a resonant synthesizer filter.
Minimum phase and inverses
If all zeros are also inside the circle, the filter is minimum phase: its inverse (which swaps poles and zeros) is stable too. Equalizers that undo a channel's response need this; a zero outside the circle cannot be inverted causally and stably.
In software
np.rootsandscipy.signal.tf2zpk/zpk2tfconvert between coefficients and poles/zeros;zpk2sosbuilds stable second-order sections.- Filter design by pole placement is the basis of resonant filters, formant synthesis of vowels and many control loops.
Exercises
Exercise 1: Stable?
Is stable?
Answer
Yes: the poles are 0.8 and 0.7.
Solution
, both inside the unit circle.
Exercise 2: Place a notch
Where must the zeros go to block kHz at kHz?
Answer
At .
Solution
. Zeros at give the numerator .
Exercise 3: Watch an unstable filter (code)
Run the impulse response of the resonator with , for 200 samples and report the largest magnitude in the first and last 20 samples.
Answer
It grows by a factor of roughly between them.
Solution
import numpy as np
r, th = 1.02, 0.3
a1, a2 = -2 * r * np.cos(th), r * r
y = np.zeros(200)
for n in range(200):
y[n] = (1.0 if n == 0 else 0.0) - a1 * (y[n - 1] if n >= 1 else 0) - a2 * (y[n - 2] if n >= 2 else 0)
print(round(float(np.max(np.abs(y[:20]))), 2), round(float(np.max(np.abs(y[-20:]))), 2), round(1.02 ** 180, 1))4.54 154.11 35.3
Test yourself
A causal LTI system is stable when…
- all zeros are inside the unit circle
- all poles are strictly inside the unit circle
- it has no poles
- the gain is below 1
A zero exactly on the unit circle at angle causes…
- a resonance at
- zero gain at
- instability
- a delay
Moving a pole closer to the unit circle makes the resonance…
- wider
- sharper and taller
- disappear
- move to DC