---
title: Magnitude, phase and group delay
heading: Frequency response in decibels, phase and its ambiguities, group delay as the delay of a narrowband envelope, and the contribution of each pole and zero
eyebrow: S7 · Lesson 12 · Magnitude, phase and group delay
xp: 50
---

::: hook
Two filters can have identical magnitude responses and still do very different things to a signal, because the phase response decides when each frequency arrives. For a narrowband burst, what matters is the slope of the phase, the group delay: it says how long the burst's envelope takes to pass through. A filter whose group delay varies across its passband smears pulses and distorts data symbols even when every frequency passes at full strength. This lesson computes group delay pole by pole and zero by zero, so a pole–zero plot predicts not only what a filter passes but how long things take.
:::

::: play
- The group delay of a two-pole resonator with poles at $re^{\pm j\theta}$, from the sum of each pole's contribution $\frac{r\cos(\omega - \theta) - r^2}{1 - 2r\cos(\omega - \theta) + r^2}$.
- Near the pole angle the delay peaks, and the closer the poles are to the unit circle the taller and narrower the peak.
- With r = 0.95 the resonator delays a tone at its center by about 18.5 samples, while far from resonance the delay is small or even negative.
:::
:::

```sim plot
view: graph
x: w = 0..3.1416
y: t = -5..45
slider: r = 0.3..0.98 = 0.95
slider: c = 0.2..2.9 = 1
plot: (r*cos(w - c) - r^2)/(1 - 2*r*cos(w - c) + r^2) + (r*cos(w + c) - r^2)/(1 - 2*r*cos(w + c) + r^2) | samples: 800 | label: group delay, samples
readout: delay at the pole angle, samples = (r - r^2)/(1 - r)^2 + (r*cos(2*c) - r^2)/(1 - 2*r*cos(2*c) + r^2)
```

::: predict
## A linear-phase FIR filter has 101 taps and runs at 48 kHz. How long does it delay every frequency?

- [ ] It depends on the frequency
- [x] 50 samples, about 1.04 ms, at every frequency
- [ ] 101 samples
- [ ] Nothing, since FIR filters have no feedback

::: reveal
A symmetric FIR filter of N taps has phase $-\omega(N - 1)/2$ plus jumps of π where the response changes sign, so its group delay is (N − 1)/2 = 50 samples at every frequency: 50/48,000 s = 1.04 ms. Every frequency is delayed equally, so waveforms pass through undistorted, only late.
:::
:::

::: nameit
## Magnitude and phase

Write $H(e^{j\omega}) = |H(e^{j\omega})|e^{j\angle H(e^{j\omega})}$. Magnitudes are usually plotted in dB, and for a rational system the dB magnitude, phase and group delay are sums of one term per pole and zero.

- The **principal value** of the phase, ARG, jumps by 2π when it wraps; the **continuous (unwrapped) phase** arg doesn't. A real zero of the response also makes the phase jump by π.
- **Phase delay** $\tau_p(\omega) = -\angle H/\omega$; **group delay**

$$\tau(\omega) = -\frac{d}{d\omega}\arg H(e^{j\omega})$$

the delay of a narrowband envelope centered on ω.

## One pole or zero at a time

A zero factor $(1 - re^{j\theta}e^{-j\omega})$ contributes

$$\text{grd} = \frac{r^2 - r\cos(\omega - \theta)}{1 + r^2 - 2r\cos(\omega - \theta)}$$

and a pole contributes the negative of that. At ω = θ a pole adds $\frac{r}{1 - r}$ samples, a zero inside the circle subtracts the same, and a zero exactly on the unit circle contributes a constant ½ sample (apart from its π jump).

## Linear phase

$h[n] = h[N - 1 - n]$ (symmetric) or $-h[N - 1 - n]$ gives $\arg H = -\omega\frac{N - 1}{2}$ (+ constants and π jumps): a constant group delay of (N − 1)/2 samples. Only FIR filters can have exactly linear phase while being causal and stable.
:::

::: example
## A single pole at z = 0.9. What's its group delay at ω = 0, at ω = 0.5 and at ω = π?

::: solution
1. **Group delay of the pole.**
   $$\tau(\omega) = \frac{0.9\cos\omega - 0.81}{1 - 1.8\cos\omega + 0.81}$$
2. **At ω = 0.**
   $$\begin{aligned} \tau(0) &= \frac{0.09}{0.01} \\ &= 9\ \text{samples} \end{aligned}$$
3. **At ω = 0.5.**
   $$\begin{aligned} \tau(0.5) &= \frac{-0.020}{0.230} \\ &= -0.088\ \text{sample} \end{aligned}$$
4. **At ω = π.**
   $$\begin{aligned} \tau(\pi) &= \frac{-1.71}{3.61} \\ &= -0.47\ \text{sample} \end{aligned}$$
5. **Shape.** It's a lowpass with a long delay at DC and a slightly negative one beyond ω = arccos 0.9 = 0.45.

**Answer:** 9 samples at ω = 0, −0.088 sample at 0.5 and −0.47 sample at π.
:::
:::

::: example
## Two tones at ω = 0.05 and ω = 0.3 pass through that pole. By how much does their delay differ?

::: solution
1. **At ω = 0.05.**
   $$\begin{aligned} \tau &= \frac{0.8989 - 0.81}{1.81 - 1.7978} \\ &= \frac{0.0889}{0.0122} \\ &= 7.3\ \text{samples} \end{aligned}$$
2. **At ω = 0.3.**
   $$\begin{aligned} \tau &= \frac{0.8598 - 0.81}{1.81 - 1.7196} \\ &= 0.55\ \text{sample} \end{aligned}$$
3. **The difference.** A pulse containing both is pulled apart by about 6.7 samples: phase distortion, even though both tones are in the filter's passband.

**Answer:** their delays differ by about 6.7 samples: 7.3 against 0.55.
:::
:::

::: example
## A resonator has poles at $0.9e^{\pm j\pi/4}$ and no zeros. What group delay does it have at its peak, ω = π/4?

::: solution
1. **The pole at the peak.** It contributes
   $$\frac{r}{1 - r} = 9\ \text{samples}$$
2. **Its conjugate.** The conjugate pole, π/2 away, contributes
   $$\begin{aligned} \tau &= -\frac{r^2 - r\cos(\pi/2)}{1 + r^2} \\ &= -\frac{0.81}{1.81} \\ &= -0.45\ \text{samples} \end{aligned}$$
3. **Total.**
   $$\begin{aligned} \tau &= 9 - 0.45 \\ &= 8.55\ \text{samples} \end{aligned}$$
4. **What it means.** A narrow resonance delays signals near its center far more than its pole count suggests, which is why sharp IIR filters smear transients.

**Answer:** 8.55 samples at ω = π/4.
:::
:::

::: check
given: a = 0.5 | 0.8 | 0.95; w = 0.2 | 0.4 | 0.8
answer: (a*cos(w) - a^2)/(1 - 2*a*cos(w) + a^2)
tolerance: 0.5%

## A single real pole at z = {a}. What's its group delay at ω = {w}, in samples?

::: right
Right. $\frac{a\cos\omega - a^2}{1 - 2a\cos\omega + a^2}$ = {answer}.
:::

::: misses
- [a/(1 - a)] That's the value at ω = 0 only.
- [any] Not yet. $-\frac{d}{d\omega}$ of the pole's phase.
:::
:::

::: check
given: r = 0.5 | 0.8 | 0.95
answer: -r/(1 - r)
tolerance: 0.5%

## A zero at $re^{j\theta}$ with r = {r}. What group delay does it contribute at ω = θ?

::: right
Right. $\frac{r^2 - r}{(1 - r)^2} = -\frac{r}{1 - r}$ = {answer} samples.
:::

::: misses
- [r/(1 - r)] A zero subtracts what a pole at the same place would add.
- [any] Not yet. Evaluate the zero's formula at ω = θ.
:::
:::

::: check
given: N = 31 | 64 | 129; s = 8 | 44.1 | 96
answer: (N - 1)/2/s
unit: ms
tolerance: 0.5%

## A linear-phase FIR filter with {N} taps runs at {s} kHz. What's its delay?

::: right
Right. (N − 1)/2 samples = {answer} ms.
:::

::: misses
- [N/2/s] The delay is (N − 1)/2, the center tap.
- [N/s] Half the length, not the full length.
- [any] Not yet. The symmetry center is at (N − 1)/2.
:::
:::

::: check
given: a = 0.7 | 0.9; u = 0.02 | 0.05; v = 0.3 | 0.6
answer: (a*cos(u) - a^2)/(1 - 2*a*cos(u) + a^2) - (a*cos(v) - a^2)/(1 - 2*a*cos(v) + a^2)
tolerance: 0.5%

## A pole at {a}. How much longer is the group delay at ω = {u} than at ω = {v}?

::: right
Right. {answer} samples.
:::

::: misses
- [any] Not yet. Evaluate the pole's group delay at both frequencies and subtract.
:::
:::

::: check
given: r = 0.8 | 0.9 | 0.97; c = 0.5 | 1.2 | 2
answer: (r - r^2)/(1 - r)^2 + (r*cos(2*c) - r^2)/(1 - 2*r*cos(2*c) + r^2)
tolerance: 0.5%

## A resonator has poles at {r}e^{±j{c}}. What's its group delay at ω = {c}?

::: right
Right. The near pole gives r/(1 − r), the far one a small correction: {answer} samples.
:::

::: misses
- [r/(1 - r)] Add the conjugate pole's contribution, evaluated 2θ away.
- [any] Not yet. Sum both poles' group delays at ω = θ.
:::
:::

::: check
given: n = 3 | 10 | 25; w = 0.2 | 1.3
answer: n
tolerance: 0.5%

## A pure delay $z^{-\given{n}}$: what's its phase delay at ω = {w}?

::: right
Right. The phase is $-\omega n_0$, so phase delay and group delay both equal {answer} samples at every frequency.
:::

::: misses
- [n*w] That's the phase lag in radians; divide by ω.
- [any] Not yet. $\tau_p = -\angle H/\omega$.
:::
:::

::: check
kind: parts
given: r = 0.8 | 0.9 | 0.95; t = 0.5 | 1 | 2

## A resonator has poles at {r}$e^{\pm j\given{t}}$ and no zeros.

::: part
answer: r/(1 - r)
tolerance: 0.5%

### What does the pole at the peak contribute to the group delay at ω = {t}?

::: misses
- [any] $r/(1 - r)$ at ω = θ.
:::
:::

::: part
answer: r/(1 - r) - (r^2 - r*cos(2*t))/(1 + r^2 - 2*r*cos(2*t))
tolerance: 0.5%

### What is the total group delay there?

::: misses
- [any] Add the conjugate pole's contribution, $-\frac{r^2 - r\cos2\theta}{1 + r^2 - 2r\cos2\theta}$.
:::
:::
:::

::: check
kind: derivation
vars: r = 0.1..0.99, t = 0..3, w = 0..3.14

## A single pole at $re^{jt}$ is observed at frequency w.

::: step
answer: -(r^2 - r*cos(w - t))/(1 + r^2 - 2*r*cos(w - t))

### What group delay does it contribute?
:::

::: step
answer: r/(1 - r)

### What is that at w = t?
:::

::: step
answer: -r/(1 + r)

### And at w = t + π, opposite it?
:::

::: right
Right. A pole adds delay near its own angle and slightly reduces it on the far side of the circle.
:::
:::

::: explain
## Why does a filter with non-constant group delay distort a pulse even when its passband magnitude is flat?

::: model
A pulse is made of many frequencies whose relative phases line them up into a sharp shape. Group delay says how long each narrow band of frequencies takes to get through the filter. If it's the same everywhere, all the components arrive together, merely late, and the pulse emerges intact. If it varies, the components that make up the pulse arrive at different times, so their phases no longer line up at one instant and the pulse spreads and rings, even though each component has the right amplitude. In data links that spreading blurs one symbol into the next, which is why receivers either use linear-phase filters or add all-pass equalizers to flatten the delay.
:::
:::

::: practice

::: check
given: a = 0.6 | 0.85; w = 0.05 | 0.5
answer: (a*cos(w) - a^2)/(1 - 2*a*cos(w) + a^2)
tolerance: 0.5%

## Pole at {a}: group delay at ω = {w}?

::: misses
- [any] $\frac{a\cos\omega - a^2}{1 - 2a\cos\omega + a^2}$.
:::
:::

::: check
given: N = 21 | 255; s = 16 | 48
answer: (N - 1)/2/s
unit: ms
tolerance: 0.5%

## Delay of a {N}-tap linear-phase FIR at {s} kHz?

::: misses
- [any] (N − 1)/2 samples.
:::
:::

::: check
given: r = 0.85 | 0.96; c = 0.8 | 1.6
answer: (r - r^2)/(1 - r)^2 + (r*cos(2*c) - r^2)/(1 - 2*r*cos(2*c) + r^2)
tolerance: 0.5%

## Resonator group delay at its peak: r {r}, θ {c}?

::: misses
- [any] Sum of both poles' delays at ω = θ.
:::
:::
:::
