TExcelTAD
Home › Signals, Systems & Digital Filters for Engineers › Poles, Zeros and Stability in the z-Plane

Poles, Zeros and Stability in the z-Plane

The mains-rejecting average needed 20 taps and still dented a 10 Hz10\ \text{Hz} signal by 0.6 dB0.6\ \text{dB}. A second-order recursive filter can remove 50 Hz50\ \text{Hz} with five coefficients and leave everything a few hertz away untouched. You design it not by solving equations but by placing two zeros and two poles on the z-plane, because the magnitude response can be read off that picture with a ruler. This lesson teaches that geometric view, the stability rule it gives, and how pole radius relates to bandwidth and settling time. The mathematics is in Poles and Zeros; the s-plane version is in Circuit Theory.

Factored form and the geometric picture

Factor the numerator and denominator of H(z)H(z):

H(z)=K ∏i(z−zi)∏k(z−pk),∣H(ejΩ)∣=K ∏i∣ejΩ−zi∣∏k∣ejΩ−pk∣H(z) = K\,\frac{\prod_i (z - z_i)}{\prod_k (z - p_k)}, \qquad \lvert H(e^{j\Omega}) \rvert = K\,\frac{\prod_i \lvert e^{j\Omega} - z_i \rvert}{\prod_k \lvert e^{j\Omega} - p_k \rvert}

As Ω\Omega runs from 00 (DC, z=1z = 1) to π\pi (fs/2f_s/2, z=−1z = -1), the point ejΩe^{j\Omega} walks around the upper half of the unit circle. The gain at each frequency is the product of its distances to the zeros divided by the product of its distances to the poles.

Re z Im z 1 -1 e^(j Omega) zero e^(j Omega0) pole r e^(j Omega0) o zero (on the circle: a null) x pole (inside: stable; near the circle: sharp peak or narrow notch) |H(e^jW)| = K * (product of distances to the zeros) / (product of distances to the poles) Omega = 0 is DC (z = 1), Omega = pi is fs/2 (z = -1)

Rules of thumb that follow directly:

  • A zero on the unit circle at angle Ω0\Omega_0 gives an exact null at f0=Ω0fs/2πf_0 = \Omega_0 f_s/2\pi.
  • A pole near the unit circle gives a peak; the closer, the sharper. For a pole at radius rr close to 1, the −3 dB-3\ \text{dB} width of the peak (or of a notch formed by a nearby zero) is about 2(1−r)2(1 - r) rad/sample, i.e. Δf≈(1−r)fs/π\Delta f \approx (1 - r) f_s/\pi.
  • Poles and zeros of a real filter come in conjugate pairs, so the plot is symmetric about the real axis.
  • Stability (for a causal filter): every pole strictly inside the unit circle, ∣pk∣<1\lvert p_k \rvert < 1. Zeros may be anywhere.
  • A pole at radius rr contributes a mode rnr^n that decays with a time constant of −1/ln⁡r≈1/(1−r)-1/\ln r \approx 1/(1 - r) samples: sharp filters ring for a long time.
  • A stable causal filter with all its zeros inside the circle too is minimum phase: it has the least group delay for its magnitude response, and its inverse is also stable (useful for equalisers).

Worked example: a 50 Hz notch at 1 kSa/s

Given: fs=1 kSa/sf_s = 1\ \text{kSa/s}, hum at f0=50 Hzf_0 = 50\ \text{Hz}; signals of interest below 40 Hz40\ \text{Hz}.

Find: a second-order notch with unity DC gain and a notch about 6 Hz6\ \text{Hz} wide; its coefficients, its gain at 10 Hz10\ \text{Hz} and its settling time.

Solve:

  • Ω0=2π⋅50/1000=0.1π\Omega_0 = 2\pi \cdot 50/1000 = 0.1\pi. Zeros on the circle at e±j0.1πe^{\pm j0.1\pi}: numerator 1−2cos⁡Ω0 z−1+z−2=1−1.9021z−1+z−21 - 2\cos\Omega_0\,z^{-1} + z^{-2} = 1 - 1.9021z^{-1} + z^{-2}.
  • Poles at the same angle, radius rr: width Δf≈(1−r)fs/π\Delta f \approx (1 - r)f_s/\pi, so r=0.98r = 0.98 gives 6.37 Hz6.37\ \text{Hz}. Denominator 1−2rcos⁡Ω0 z−1+r2z−2=1−1.8641z−1+0.9604z−21 - 2r\cos\Omega_0\,z^{-1} + r^2 z^{-2} = 1 - 1.8641z^{-1} + 0.9604z^{-2}.
  • DC gain before scaling: H(1)=(2−1.9021)/(1−1.8641+0.9604)=1.0162H(1) = (2 - 1.9021)/(1 - 1.8641 + 0.9604) = 1.0162; divide the numerator by it.
  • Pole time constant −1/ln⁡0.98=49.5-1/\ln 0.98 = 49.5 samples =49.5 ms= 49.5\ \text{ms}: allow about 5 time constants, 0.25 s0.25\ \text{s}, for the notch to settle after switch-on or a hum change.

Check: SciPy's iirnotch(50, Q, fs=1000) designs the same structure; its quality factor Q=f0/Δf=50/6.37=7.85Q = f_0/\Delta f = 50/6.37 = 7.85 should give nearly the same coefficients.

python · try it yourself
import numpy as np
from scipy.signal import freqz, iirnotch, tf2zpk

fs, f0, r = 1000.0, 50.0, 0.98
W0 = 2 * np.pi * f0 / fs
b = np.array([1.0, -2 * np.cos(W0), 1.0])
a = np.array([1.0, -2 * r * np.cos(W0), r**2])
b = b * a.sum() / b.sum()                          # unity gain at DC
print("b =", np.round(b, 5), " a =", np.round(a, 5))
z, p, _ = tf2zpk(b, a)
print(f"|zeros| = {np.abs(z).round(4)}, |poles| = {np.abs(p).round(4)}, pole angle = {np.degrees(np.angle(p[0])):.1f} deg")

f_test = [10.0, 40.0, 47.0, 50.0, 53.0, 60.0, 200.0]
_, H = freqz(b, a, worN=f_test, fs=fs)
print("gain (dB):", ", ".join(f"{f:.0f} Hz {20 * np.log10(max(abs(h), 1e-12)):.2f}" for f, h in zip(f_test, H)))

f, Hf = freqz(b, a, worN=20000, fs=fs)
band = f[np.abs(Hf) < 1 / np.sqrt(2)]
print(f"-3 dB notch from {band.min():.2f} to {band.max():.2f} Hz: width {band.max() - band.min():.2f} Hz")

bq, aq = iirnotch(f0, Q=f0 / ((1 - r) * fs / np.pi), fs=fs)
print("iirnotch b =", np.round(bq, 5), " a =", np.round(aq, 5))
print(f"pole time constant: {-1 / np.log(r):.1f} samples = {1e3 * -1 / np.log(r) / fs:.1f} ms")
b = [ 0.98409 -1.87184  0.98409]  a = [ 1.      -1.86407  0.9604 ]
|zeros| = [1. 1.], |poles| = [0.98 0.98], pole angle = 18.0 deg
gain (dB): 10 Hz -0.00, 40 Hz -0.40, 47 Hz -3.29, 50 Hz -240.00, 53 Hz -3.29, 60 Hz -0.40, 200 Hz 0.03
-3 dB notch from 46.83 to 53.18 Hz: width 6.35 Hz
iirnotch b = [ 0.98039 -1.86481  0.98039]  a = [ 1.      -1.86481  0.96078]
pole time constant: 49.5 samples = 49.5 ms

The notch is 6.35 Hz6.35\ \text{Hz} wide, as predicted (4747 and 53 Hz53\ \text{Hz} sit near its −3 dB-3\ \text{dB} edges), and the 10 Hz10\ \text{Hz} signal passes untouched (a gain of 1.00001.0000, against −0.58 dB-0.58\ \text{dB} for the 20-tap average). iirnotch uses the same structure but computes the pole radius from the exact bandwidth formula (r=0.96078=0.9802r = \sqrt{0.96078} = 0.9802) instead of the approximation, so its coefficients differ in the fourth digit.

Stability at a glance

Any recursive filter can be checked by finding the roots of a. The picture also shows how stable: poles at radius 0.9990.999 are stable on paper but ring for thousands of samples, and the coefficient rounding of fixed-point implementations can push them out.

python · try it yourself
import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import freqz

filters = {"notch r = 0.98": ([0.98409, -1.87185, 0.98409], [1, -1.86407, 0.9604]),
           "a = [1, -1.8, 0.9]": ([1.0], [1, -1.8, 0.9]),
           "a = [1, -2.1, 1.1]": ([1.0], [1, -2.1, 1.1])}
for name, (b, a) in filters.items():
    p = np.roots(a)
    print(f"{name:20s} |poles| = {np.round(np.abs(p), 4)} -> {'stable' if np.all(np.abs(p) < 1) else 'UNSTABLE'}")

b, a = filters["notch r = 0.98"]
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(8, 3.4))
th = np.linspace(0, 2 * np.pi, 400)
ax1.plot(np.cos(th), np.sin(th), "k:", lw=1)
ax1.plot(np.roots(b).real, np.roots(b).imag, "o", mfc="none", ms=9, label="zeros")
ax1.plot(np.roots(a).real, np.roots(a).imag, "x", ms=9, label="poles")
ax1.set_aspect("equal"); ax1.set_title("z-plane"); ax1.legend(loc="lower left", fontsize=8)
f, H = freqz(b, a, worN=4096, fs=1000.0)
ax2.plot(f, 20 * np.log10(np.maximum(np.abs(H), 1e-5)))
ax2.set(xlabel="frequency (Hz)", ylabel="gain (dB)", ylim=(-50, 3), title="magnitude")
ax2.grid(True, alpha=0.3)
plt.tight_layout(); plt.show()
notch r = 0.98       |poles| = [0.98 0.98] -> stable
a = [1, -1.8, 0.9]   |poles| = [0.9487 0.9487] -> stable
a = [1, -2.1, 1.1]   |poles| = [1.1 1. ] -> UNSTABLE

The second filter's poles have radius 0.9=0.9487\sqrt{0.9} = 0.9487 (for a conjugate pair, r2r^2 is the last coefficient). The third has a pole at exactly 1 (an accumulator) and one outside.

Guided lab: a notch filter on a board

Hand calculation. The notch above: 0 dB0\ \text{dB} at 10 Hz10\ \text{Hz}, −3.3 dB-3.3\ \text{dB} at 47 Hz47\ \text{Hz}, a null at 50 Hz50\ \text{Hz}, settling about 0.25 s0.25\ \text{s}.

Simulation. Change r to 0.9950.995: the notch narrows to about 1.6 Hz1.6\ \text{Hz} and the time constant grows to 200 samples. A narrower notch removes less of the signal, but needs a more exact hum frequency and settles more slowly.

What you would measure. Implement the difference equation in floating point at 1 kSa/s1\ \text{kSa/s} (timer interrupt), feed 50 Hz50\ \text{Hz} and 10 Hz10\ \text{Hz} sines from a function generator (1 V1\ \text{V} amplitude on a 1.5 V1.5\ \text{V} offset) and log the output. Expect the 10 Hz10\ \text{Hz} amplitude unchanged within 1 %1\,\% and the 50 Hz50\ \text{Hz} tone attenuated by 4040 to 60 dB60\ \text{dB}: the depth is limited by the generator's frequency accuracy relative to the board's clock, the ADC noise and, in fixed point, the rounding of the coefficients. Step the generator from 10 Hz10\ \text{Hz} to 50 Hz50\ \text{Hz} and watch the residual decay over about a quarter of a second.

Hazards and safe setup. Use the generator, never mains, as the hum source. USB power, input checked on a scope to stay within 00 to 3 V3\ \text{V}, 1 kΩ1\ \text{k}\Omega series resistor.

Pitfalls

  • Putting the notch poles on the unit circle (an oscillator, not a filter) or, after rounding, outside it.
  • Asking for a very narrow notch and forgetting that it takes ≈1/(1−r)\approx 1/(1 - r) samples to settle.
  • Reading pole angles in radians per sample as hertz: f=Ωfs/2πf = \Omega f_s/2\pi.
  • Judging stability from the numerator: only the poles matter.

Practice

  1. A resonator has poles at 0.95 e±jπ/40.95\,e^{\pm j\pi/4} and fs=8 kSa/sf_s = 8\ \text{kSa/s}. At what frequency does it peak, roughly how wide is the peak, and is it stable?
  2. Write the denominator coefficients for poles at 0.9 e±jπ/20.9\,e^{\pm j\pi/2}.
  3. A filter has a zero at z=−1z = -1. What is its gain at fs/2f_s/2?
Answer
  1. f=(π/4)/(2π)×8000=1 kHzf = (\pi/4)/(2\pi) \times 8000 = 1\ \text{kHz}; width ≈(1−0.95)×8000/π=127 Hz\approx (1 - 0.95) \times 8000/\pi = 127\ \text{Hz}; stable (r<1r < 1).
  2. 1−2(0.9)cos⁡(π/2)z−1+0.81z−2=1+0.81z−21 - 2(0.9)\cos(\pi/2)z^{-1} + 0.81z^{-2} = 1 + 0.81z^{-2}: a = [1, 0, 0.81].
  3. Zero (z=−1z = -1 is fs/2f_s/2).

Test yourself

A causal digital filter is stable when

  1. all zeros are inside the unit circle
  2. all poles are inside the unit circle
  3. all poles have negative real parts
  4. the numerator is symmetric

To place an exact null at f0f_0, put

  1. a pole on the unit circle at angle 2πf0/fs2\pi f_0/f_s
  2. a zero on the unit circle at angle 2πf0/fs2\pi f_0/f_s
  3. a zero at the origin
  4. a pole at z=1z = 1

Moving a notch's poles from r=0.98r = 0.98 to r=0.995r = 0.995 makes the notch

  1. wider and faster
  2. narrower and slower to settle
  3. unstable
  4. deeper only

For a conjugate pole pair, the coefficient a2a_2 of 1+a1z−1+a2z−21 + a_1z^{-1} + a_2z^{-2} equals

  1. rr
  2. r2r^2
  3. 2rcos⁡Ω02r\cos\Omega_0
  4. −2r-2r