D5 · Lesson 6 · Placing poles and zeros
Reading a digital filter's frequency response off the unit circle, zeros that pull the response to nothing and poles that push it up, angle as frequency and radius as sharpness, designing a 60 Hz notch and a resonator by hand, and the coefficients that place them
A digital filter's transfer function H(z) is a ratio of polynomials, and its roots, the zeros of the top and the poles of the bottom, are points in the complex plane. The frequency response is H evaluated around the unit circle, from 0 at z = 1 to the Nyquist frequency at z = −1. A zero sitting on the circle kills the response at that frequency; a pole just inside it makes a sharp peak. With that picture, simple but useful filters, such as a notch to remove mains hum or a resonator to pick out one tone, can be designed by placing a few points.
- A notch filter: a pair of zeros on the unit circle at angle ±θ, and a pair of poles at the same angle just inside, at radius r.
- The zeros make the response exactly zero at the frequency ; the poles, almost on top of them, restore the response everywhere else.
- The closer r is to 1, the narrower the notch. Pushing r past 1 puts the poles outside the circle and the filter goes unstable.
Predict
A 1 kHz sampled ECG has 60 Hz hum. At what angle should the notch's zeros sit on the unit circle?
The unit circle runs from 0 Hz at angle 0 to the sampling rate at a full turn, so 60 Hz is at 360° × 60/1000 = 21.6°, or 0.377 rad. Zeros at make H exactly zero at 60 Hz. With poles at radius 0.98 at the same angle, the notch is about 6.4 Hz wide.
Name it
Frequency on the unit circle
A frequency f corresponds to the point with
so DC is at z = 1, at z = j, and the Nyquist frequency at z = −1. The magnitude response at that point is the product of the distances to the zeros divided by the product of the distances to the poles (times a constant).
Zeros and poles
- A zero on the unit circle makes the response exactly zero there.
- A pole at radius r near the circle makes a peak whose −3 dB width is about
and whose impulse response rings with envelope .
- Every pole must be inside the unit circle for stability.
Real-valued filters have their poles and zeros in conjugate pairs. A pair at radius r and angle ±θ contributes the factor , so the difference equation's coefficients are and .
Two classic designs
- Notch: zeros on the circle and poles at radius r at the same angle.
- Resonator: poles only, at radius r and angle θ, with zeros at ±1 to block DC and Nyquist. It picks one frequency out of noise, as in the Goertzel tone detector (C9).
Worked example
Write the 60 Hz notch at 1 kHz with r = 0.98 as a difference equation.
Show the solution
- Zeros.
- Poles.
- Difference equation.
- DC gain. Its DC gain is 1.017; dividing the zeros' coefficients by that makes it exactly 1.
Answer , with the zeros' coefficients divided by 1.017 for a DC gain of exactly 1.
Worked example
What pole radius gives a notch only 2 Hz wide at 1 kHz?
Show the solution
- Pole radius. Set the notch width to 2 Hz:
- Transient. The narrower notch also means the filter's transient lasts longer:
Answer r = 0.9937, with a transient of about 159 samples, 0.16 s.
Worked example
The two-tap average has a zero at z = −1. What is its gain at DC, at and at ?
Show the solution
- Gain formula.
- At DC. Here , so the gain is 1.
- At . Here :
- At . Here and the gain is 0, where the zero sits on the unit circle. A zero on the circle removes its frequency completely.
Answer the gain is 1 at DC, 0.707 at and 0 at .
Check
A notch must remove 60 Hz from a signal sampled at 1 kHz. At what angle go its zeros?
Check
A pole pair at radius 0.95 makes a peak in a filter sampled at 1 kHz. About how wide is it at −3 dB?
Write units the way you normally would: 1.5 Hz, 1500 mHz and 0.0015 kHz are the same answer.
Check
A pole pair sits at radius 0.95 and angle ±20°. What's the coefficient in ?
Check
What pole radius gives a notch about 2 Hz wide at a sampling rate of 0.5 kHz?
Check
A notch at 50 Hz runs at 1 kHz with pole radius 0.99.
(a)
At what angle do its zeros sit on the unit circle?
(b)
About how wide is the notch?
Write units the way you normally would: 1.5 Hz, 1500 mHz and 0.0015 kHz are the same answer.
Check
The two-tap average has ; consider a tone at 0.125 times the sample rate.
(a)
What is its gain there?
(b)
What attenuation is that in dB?
Explain why
Why does moving a pole closer to the unit circle make a sharper peak?
The magnitude response at any frequency is found by standing at that frequency's point on the unit circle and dividing the distances to the zeros by the distances to the poles. A pole just inside the circle is very close to the circle's point at its own angle, so that distance is tiny and the response there is large. Moving a little way along the circle, the distance grows quickly in proportion to how far you've moved compared with the pole's gap from the circle. The smaller that gap, the more sharply the distance grows as you move away, so the peak becomes both taller and narrower. A pole exactly on the circle makes an infinite peak, and one outside makes the filter unstable.
Practice
Keep practicing
8 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.