---
title: Placing poles and zeros on the z-plane
heading: 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
eyebrow: D5 · Lesson 6 · Placing poles and zeros
xp: 40
---

::: hook
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.
:::

::: play
- 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 $\theta f_s/2\pi$; 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.
:::

```sim plot
view: zplane
range: 1.4
slider: theta = 1..90 = 21.6 step 0.1 °
slider: r = 0.5..1.05 = 0.98 step 0.005
num: z^2 - 2*cos(theta°)*z + 1
den: z^2 - 2*r*cos(theta°)*z + r^2
readout: notch frequency at 1 kHz sampling, Hz = theta/360*1000 | digits: 4
readout: approximate −3 dB width, Hz = (1 - r)*1000/pi | digits: 3
```

```sim plot
view: graph
x: f = 0..500
y: H = -40..6
slider: theta = 1..90 = 21.6 step 0.1 °
slider: r = 0.5..0.999 = 0.98 step 0.001
plot: 20*log(abs((exp(2*j*2*pi*f/1000) - 2*cos(theta*pi/180)*exp(j*2*pi*f/1000) + 1)/(exp(2*j*2*pi*f/1000) - 2*r*cos(theta*pi/180)*exp(j*2*pi*f/1000) + r^2)) + 1e-9) | samples: 1000 | label: notch response, dB (f in Hz at 1 kHz sampling)
```

::: predict
## A 1 kHz sampled ECG has 60 Hz hum. At what angle should the notch's zeros sit on the unit circle?

- [ ] 60°
- [x] 21.6°
- [ ] 6°
- [ ] 180°

::: reveal
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 $e^{\pm j0.377}$ 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.
:::
:::

::: nameit
## Frequency on the unit circle

A frequency f corresponds to the point $z = e^{j\theta}$ with

$$\theta = 2\pi\frac{f}{f_s}$$

so DC is at z = 1, $f_s/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

$$\Delta f \approx \frac{(1 - r)f_s}{\pi}$$

and whose impulse response rings with envelope $r^n$.

- 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 $z^2 - 2r\cos\theta\,z + r^2$, so the difference equation's coefficients are $a_1 = -2r\cos\theta$ and $a_2 = r^2$.

## 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).
:::

::: example
## Write the 60 Hz notch at 1 kHz with r = 0.98 as a difference equation.

::: solution
1. **Zeros.**
   $$\begin{aligned} &1 - 2\cos(0.377)z^{-1} + z^{-2} \\ &= 1 - 1.8596z^{-1} + z^{-2} \end{aligned}$$
2. **Poles.**
   $$\begin{aligned} &1 - 2(0.98)\cos(0.377)z^{-1} \\ &\quad + 0.9604z^{-2} \end{aligned}$$
3. **Difference equation.**
   $$\begin{aligned} y_n &= x_n - 1.8596x_{n-1} + x_{n-2} \\ &\quad + 1.8224y_{n-1} \\ &\quad - 0.9604y_{n-2} \end{aligned}$$
4. **DC gain.** Its DC gain is 1.017; dividing the zeros' coefficients by that makes it exactly 1.

**Answer:** $y_n = x_n - 1.8596x_{n-1} + x_{n-2}$ $+ 1.8224y_{n-1} - 0.9604y_{n-2}$, with the zeros' coefficients divided by 1.017 for a DC gain of exactly 1.
:::
:::

::: example
## What pole radius gives a notch only 2 Hz wide at 1 kHz?

::: solution
1. **Pole radius.** Set the notch width $(1 - r)f_s/\pi$ to 2 Hz:
   $$\begin{aligned} 1 - r &= \frac{\pi \times 2}{1000} \\ r &= 0.9937 \end{aligned}$$
2. **Transient.** The narrower notch also means the filter's transient lasts longer:
   $$\begin{aligned} -\frac{1}{\ln r} &= 159\ \text{samples} \\ &= 0.16\ \text{s} \end{aligned}$$

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

::: example
## The two-tap average $y_n = (x_n + x_{n-1})/2$ has a zero at z = −1. What is its gain at DC, at $f_s/4$ and at $f_s/2$?

::: solution
1. **Gain formula.**
   $$|H| = |\cos(\omega/2)|$$
2. **At DC.** Here $\omega = 0$, so the gain is 1.
3. **At $f_s/4$.** Here $\omega = \pi/2$:
   $$\cos(\pi/4) = 0.707$$
4. **At $f_s/2$.** Here $\omega = \pi$ 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 $f_s/4$ and 0 at $f_s/2$.
:::
:::

::: check
given: f = 50 | 60 | 400; s = 1 | 8 | 16
answer: 360*f/(s*1000)
unit: °
tolerance: 0.5%

## A notch must remove {f} Hz from a signal sampled at {s} kHz. At what angle go its zeros?

::: right
Right. $360° \times f/f_s$ = {answer}°.
:::

::: misses
- [180*f/(s*1000)] The full circle is the sampling rate, so use 360°.
- [any] Not yet. Fraction of the sampling rate, times a full turn.
:::
:::

::: check
given: r = 0.9 | 0.95 | 0.99; s = 1 | 8 | 48
answer: (1 - r)*s*1000/pi
unit: Hz
tolerance: 0.5%

## A pole pair at radius {r} makes a peak in a filter sampled at {s} kHz. About how wide is it at −3 dB?

::: right
Right. $(1 - r)f_s/\pi$ = {answer} Hz.
:::

::: misses
- [(1 - r)*s*1000] Divide by π.
- [any] Not yet. Width grows with the pole's distance from the circle.
:::
:::

::: check
given: r = 0.9 | 0.95 | 0.99; t = 20 | 45 | 120
answer: -2*r*cos(t*pi/180)
tolerance: 0.5%

## A pole pair sits at radius {r} and angle ±{t}°. What's the coefficient $a_1$ in $1 + a_1z^{-1} + a_2z^{-2}$?

::: right
Right. $a_1 = -2r\cos\theta$ = {answer}.
:::

::: misses
- [2*r*cos(t*pi/180)] Mind the sign: $(z - re^{j\theta})(z - re^{-j\theta})$.
- [r^2] That's $a_2$.
- [any] Not yet. Expand the conjugate pair.
:::
:::

::: check
given: B = 1 | 2 | 5; s = 0.5 | 1 | 2
answer: 1 - pi*B/(s*1000)
tolerance: 0.05%

## What pole radius gives a notch about {B} Hz wide at a sampling rate of {s} kHz?

::: right
Right. $r = 1 - \pi\Delta f/f_s$ = {answer}.
:::

::: misses
- [any] Not yet. Invert the width formula.
:::
:::

::: check
kind: parts
given: f = 50 | 60; fs = 1 | 2 | 8; r = 0.95 | 0.99

## A notch at {f} Hz runs at {fs} kHz with pole radius {r}.

::: part
answer: 2*pi*f/(fs*1000)*180/pi
unit: °
tolerance: 0.5%

### At what angle do its zeros sit on the unit circle?

::: misses
- [any] $2\pi f/f_s$.
:::
:::

::: part
answer: (1 - r)*fs*1000/pi
unit: Hz
tolerance: 0.5%

### About how wide is the notch?

::: misses
- [any] $(1 - r)f_s/\pi$.
:::
:::
:::

::: check
kind: parts
given: w = 0.05 | 0.1 | 0.125 | 0.2 | 0.25 | 0.3 | 0.4 | 0.45

## The two-tap average has $|H| = |\cos(\omega/2)|$; consider a tone at {w} times the sample rate.

::: part
answer: abs(cos(pi*w))
tolerance: 0.5%

### What is its gain there?

::: misses
- [any] $\omega = 2\pi \times$ {w}.
:::
:::

::: part
answer: -20*log(abs(cos(pi*w)) + 1e-12)
unit: dB
tolerance: 0.5%

### What attenuation is that in dB?

::: misses
- [any] $-20\log_{10}|H|$.
:::
:::
:::

::: explain
## Why does moving a pole closer to the unit circle make a sharper peak?

::: model
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

::: check
given: f = 10 | 4000; s = 8 | 96
answer: 360*f/(s*1000)
unit: °
tolerance: 0.5%

## Angle for {f} Hz at {s} kHz?

::: misses
- [any] $360° f/f_s$.
:::
:::

::: check
given: r = 0.5 | 0.98; t = 10 | 30 | 50 | 70 | 110 | 130 | 150 | 170
answer: -2*r*cos(t*pi/180)
tolerance: 0.5%

## $a_1$ for poles at {r}∠±{t}°?

::: misses
- [any] $-2r\cos\theta$.
:::
:::
:::
