D56 of 13
0 XP
  1. Hook
  2. Play
  3. Predict
  4. Name it
  5. Check
  6. Explain

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 θfs/2π; 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?

Name it

Frequency on the unit circle

A frequency f corresponds to the point z=ejθ with

θ=2πffs

so DC is at z = 1, fs/4 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
Δf≈(1−r)fsπ

and whose impulse response rings with envelope rn.

  • 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 z2−2rcos⁡θz+r2, so the difference equation's coefficients are a1=−2rcos⁡θ and a2=r2.

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
  1. Zeros. 1−2cos⁡(0.377)z−1+z−2=1−1.8596z−1+z−2
  2. Poles. 1−2(0.98)cos⁡(0.377)z−1+0.9604z−2
  3. Difference equation. yn=xn−1.8596xn−1+xn−2+1.8224yn−1−0.9604yn−2
  4. DC gain. Its DC gain is 1.017; dividing the zeros' coefficients by that makes it exactly 1.

Answer yn=xn−1.8596xn−1+xn−2 +1.8224yn−1−0.9604yn−2, 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
  1. Pole radius. Set the notch width (1−r)fs/π to 2 Hz: 1−r=π×21000r=0.9937
  2. Transient. The narrower notch also means the filter's transient lasts longer: −1ln⁡r=159samples=0.16s

Answer r = 0.9937, with a transient of about 159 samples, 0.16 s.

Worked example

The two-tap average yn=(xn+xn−1)/2 has a zero at z = −1. What is its gain at DC, at fs/4 and at fs/2?

Show the solution
  1. Gain formula. |H|=|cos⁡(ω/2)|
  2. At DC. Here ω=0, so the gain is 1.
  3. At fs/4. Here ω=π/2: cos⁡(π/4)=0.707
  4. At fs/2. 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 fs/4 and 0 at fs/2.

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 a1 in 1+a1z−1+a2z−2?

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 |H|=|cos⁡(ω/2)|; 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?

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.