---
title: IIR design by impulse invariance and the bilinear transform
heading: Turning analog prototypes into digital filters, sampling the impulse response and its aliasing, the bilinear map and its frequency warping, and a complete Butterworth design
eyebrow: S7 · Lesson 19 · IIR design by impulse invariance and the bilinear transform
xp: 50
---

::: hook
Decades of analog filter theory, Butterworth, Chebyshev and elliptic designs with tables of element values and closed-form orders, can be reused for digital filters if there's a good way to map a continuous-time system into a discrete-time one. Two maps dominate. Impulse invariance samples the analog impulse response, preserving its shape in time but aliasing its frequency response. The bilinear transform squeezes the entire analog frequency axis onto the unit circle without any aliasing, at the price of warping frequencies, a distortion that's harmless once it's accounted for by prewarping the specification.
:::

::: play
- A digital Butterworth lowpass of order N designed by the bilinear transform with cutoff $\omega_c$ (solid), against the analog prototype's response read on the same axis as if no warping happened (dashed).
- At low frequencies the two agree. Toward ω = π the bilinear version falls much faster: the whole analog axis from $\Omega_c$ to infinity is compressed into the interval from $\omega_c$ to π.
- The digital filter is exactly 3 dB down at $\omega_c$, because the design prewarps the cutoff with $\Omega_c = \frac{2}{T}\tan\frac{\omega_c}{2}$.
:::
:::

```sim plot
view: graph
x: w = 0.01..3.13
y: H = -80..2 dB
slider: N = 1..8 = 4 step 1
slider: c = 0.1..2.8 = 0.8
plot: -10*log(1 + (tan(w/2)/tan(c/2))^(2*N)) | samples: 800 | label: bilinear Butterworth
plot: -10*log(1 + (w/c)^(2*N)) | samples: 800 | dashed | color: ch3 | label: analog prototype at Ω = ω
plot: -3.01 | dashed | label: −3 dB
```

::: predict
## An analog bandpass filter has a big response near 0.6 times the sampling rate. It's converted by impulse invariance. What happens to that response?

- [ ] It disappears, because digital filters stop at the Nyquist frequency
- [x] It aliases down, folding onto 0.4 times the sampling rate
- [ ] It's preserved exactly
- [ ] It's mapped to π by warping

::: reveal
Impulse invariance samples the analog impulse response, so its frequency response is the analog one with copies every $f_s$, and anything above $f_s/2$ folds back. A response at $0.6f_s$ lands at $0.4f_s$. That's why impulse invariance is only used for filters whose analog response is already negligible above half the sampling rate: lowpass and bandpass designs, never highpass.
:::
:::

::: nameit
## Impulse invariance

Sample the analog impulse response: $h[n] = Th_c(nT)$. Each analog pole $s_k$ maps to a digital pole

$$z_k = e^{s_kT}$$

(so the left half-plane maps inside the unit circle, and stability is kept), with the partial-fraction residues unchanged. The frequency response is the aliased sum $H(e^{j\omega}) = \sum_kH_c\left(j\frac{\omega + 2\pi k}{T}\right)$, close to $H_c(j\omega/T)$ only if the analog response is small beyond π/T.

## The bilinear transform

$$s = \frac{2}{T}\,\frac{1 - z^{-1}}{1 + z^{-1}}$$

maps the left half-plane inside the unit circle and the whole $j\Omega$ axis onto the unit circle once, so there's no aliasing. Frequencies warp:

$$\Omega = \frac{2}{T}\tan\frac{\omega}{2}, \qquad \omega = 2\arctan\frac{\Omega T}{2}$$

A real pole maps as $z = \frac{1 + sT/2}{1 - sT/2}$.

## The design procedure

1. Write the digital specification in ω.
2. **Prewarp** each band edge: $\Omega = \frac{2}{T}\tan\frac{\omega}{2}$ (T cancels out of the final result, so T = 1 or 2 is fine).
3. Design the analog prototype to meet the prewarped specification (order and cutoff from lesson 21 of S6 or C4's formulas).
4. Substitute the bilinear transform.

Equiripple and maximally flat shapes in Ω stay equiripple and maximally flat in ω, just warped.
:::

::: example
## Design a bilinear Butterworth lowpass with at most 1 dB loss up to 0.2π and at least 15 dB beyond 0.3π.

::: solution
1. **Prewarp.** With T = 1:
   $$\begin{aligned} \Omega_p &= 2\tan(0.1\pi) \\ &= 0.6498 \end{aligned}$$
   $$\begin{aligned} \Omega_s &= 2\tan(0.15\pi) \\ &= 1.0191 \end{aligned}$$
2. **Order.**
   $$\begin{aligned} N &\ge \frac{\log\frac{10^{1.5} - 1}{10^{0.1} - 1}}{2\log(1.0191/0.6498)} \\ &= 5.30 \end{aligned}$$
   so N = 6.
3. **Cutoff.** Meeting the stopband exactly:
   $$\begin{aligned} \Omega_c &= \frac{1.0191}{(10^{1.5} - 1)^{1/12}} \\ &= 0.766 \end{aligned}$$
4. **Passband check.** That leaves the passband with 0.56 dB loss, better than required. (This is Oppenheim and Schafer's Example 7.3.)

**Answer:** a sixth-order Butterworth filter with $\Omega_c$ = 0.766, which loses only 0.56 dB at the passband edge.
:::
:::

::: example
## An analog pole at s = −1000 rad/s is sampled with T = 0.1 ms. Where does each method put the digital pole?

::: solution
1. **Impulse invariance.**
   $$\begin{aligned} z &= e^{-0.1} \\ &= 0.90484 \end{aligned}$$
2. **Bilinear.**
   $$\begin{aligned} z &= \frac{1 - 0.05}{1 + 0.05} \\ &= 0.90476 \end{aligned}$$
3. **Compare.** They're nearly identical because the pole is far below the sampling rate (sT = 0.1); the methods differ for poles at high frequencies.

**Answer:** impulse invariance puts the pole at 0.90484 and the bilinear transform at 0.90476.
:::
:::

::: example
## A first-order analog lowpass with a 1 kHz corner is converted by impulse invariance at 8 kHz. Where is the digital pole, and what DC gain results?

::: solution
1. **Digital pole.** With $\omega_c = 2\pi \times 1000$ and T = 1/8000:
   $$\begin{aligned} p &= e^{-\omega_cT} \\ &= e^{-0.785} \\ &= 0.456 \end{aligned}$$
2. **DC gain.** The sampled impulse response $T\omega_ce^{-\omega_cnT}$ sums to
   $$\begin{aligned} H(1) &= \frac{0.785}{1 - 0.456} \\ &= 1.44 \end{aligned}$$
   which is 3.2 dB above the analog filter's unity DC gain.
3. **Why.** The analog response isn't bandlimited, and its tail aliases back onto DC; the bilinear transform avoids exactly this.

**Answer:** the digital pole is at 0.456, and the DC gain is 1.44, 3.2 dB above the analog filter's.
:::
:::

::: check
given: w = 0.1 | 0.25 | 0.4 | 0.7; T = 1 | 2
answer: 2/T*tan(w*pi/2)
tolerance: 0.5%

## A digital band edge sits at ω = {w}π. With T = {T}, what's the prewarped analog frequency?

::: right
Right. $\frac{2}{T}\tan\frac{\omega}{2}$ = {answer} rad/s.
:::

::: misses
- [w*pi/T] That ignores the warping: the bilinear map isn't linear in frequency.
- [any] Not yet. $\Omega = \frac{2}{T}\tan(\omega/2)$.
:::
:::

::: check
given: W = 2 | 5 | 20; T = 1 | 0.2
answer: 2*atan(W*T/2)/pi
tolerance: 0.5%

## An analog frequency of {W} rad/s goes through the bilinear transform with T = {T}. Where does it land, in units of π?

::: right
Right. $2\arctan(\Omega T/2)$ = {answer}π.
:::

::: misses
- [W*T/pi] Only at low frequencies is ω ≈ ΩT.
- [any] Not yet. $\omega = 2\arctan(\Omega T/2)$.
:::
:::

::: check
given: a = 3000 | 5000; T = 0.2 | 0.3
answer: exp(-a*T/1000)
tolerance: 0.5%

## An analog pole at s = −{a} rad/s is mapped by impulse invariance with T = {T} ms. Where's the digital pole?

::: right
Right. $e^{s_kT}$ = {answer}.
:::

::: misses
- [(1 - a*T/2000)/(1 + a*T/2000)] That's the bilinear transform's mapping.
- [any] Not yet. $z = e^{sT}$, with T in seconds.
:::
:::

::: check
given: a = 3000 | 5000; T = 0.2 | 0.3
answer: (1 - a*T/2000)/(1 + a*T/2000)
tolerance: 0.5%

## The same pole s = −{a} rad/s through the bilinear transform with T = {T} ms?

::: right
Right. $\frac{1 + sT/2}{1 - sT/2}$ = {answer}.
:::

::: misses
- [exp(-a*T/1000)] That's impulse invariance.
- [any] Not yet. Solve $s = \frac{2}{T}\frac{1 - z^{-1}}{1 + z^{-1}}$ for z.
:::
:::

::: check
given: p = 0.1 | 0.15 | 0.2; s = 0.3 | 0.4 | 0.5; A = 15 | 30
answer: log((10^(A/10) - 1)/(10^0.1 - 1))/(2*log(tan(s*pi/2)/tan(p*pi/2)))
tolerance: 0.5%

## A bilinear Butterworth design needs at most 1 dB loss to ω = {p}π and at least {A} dB from {s}π. What order does the formula give, before rounding up?

::: right
Right. {answer}, so round up to the next integer.
:::

::: misses
- [log((10^(A/10) - 1)/(10^0.1 - 1))/(2*log(s/p))] Prewarp the band edges first: use the tangents.
- [any] Not yet. Prewarp, then use the Butterworth order formula.
:::
:::

::: check
given: s = 0.55 | 0.65 | 0.8 | 0.9
answer: 1 - s
tolerance: 0.5%

## An analog bandpass response peaks at {s} times the sampling rate. After impulse invariance, at what fraction of the sampling rate does the peak appear?

::: right
Right. It folds about $f_s/2$: {answer} of $f_s$.
:::

::: misses
- [s] Above half the sampling rate, the response aliases.
- [s - 0.5] Folding reflects about $f_s/2$: the alias of $sf_s$ is $(1 - s)f_s$.
- [any] Not yet. Subtract from the nearest multiple of $f_s$.
:::
:::

::: check
kind: parts
given: f = 0.5 | 1 | 2; s = 8 | 16 | 48

## A first-order analog lowpass with a {f} kHz corner is converted by impulse invariance at {s} kHz.

::: part
answer: exp(-2*pi*f/s)
tolerance: 0.5%

### Where is the digital pole?

::: misses
- [any] $e^{-\omega_cT}$.
:::
:::

::: part
answer: 20*log(2*pi*f/s/(1 - exp(-2*pi*f/s)))
unit: dB
tolerance: 1%

### How far is its DC gain above the analog filter's?

::: misses
- [any] The sampled response sums to $\omega_cT/(1 - e^{-\omega_cT})$.
:::
:::
:::

::: check
kind: derivation
vars: a = 10..100000, T = 0.00001..0.001, w = 0.1..3

## An analog pole at s = −a is converted with sample period T; separately, a digital band edge sits at w.

::: step
answer: exp(-a*T)

### Where does impulse invariance put the pole?
:::

::: step
answer: (1 - a*T/2)/(1 + a*T/2)

### Where does the bilinear transform put it?
:::

::: step
answer: 2/T*tan(w/2)

### What analog frequency must the prototype use for the band edge?
:::

::: right
Right. For small aT the two maps agree; for large aT the bilinear pole can even turn negative while the impulse-invariant one stays positive.
:::
:::

::: explain
## Why does the bilinear transform avoid aliasing when impulse invariance doesn't?

::: model
Impulse invariance takes samples of the analog impulse response, and sampling always copies the spectrum at multiples of the sampling rate, so any analog response above half the sampling rate folds back onto lower frequencies. The bilinear transform isn't a sampling operation at all: it's an algebraic substitution that maps every point of the analog frequency axis, from zero to infinity, to exactly one point on the unit circle between zero and π. Since no two analog frequencies land on the same digital frequency, nothing can overlap. The cost is that the map is nonlinear, compressing high analog frequencies near π, which is why band edges are prewarped before the analog design.
:::
:::

::: practice

::: check
given: w = 0.1 | 0.15 | 0.25 | 0.4 | 0.5 | 0.6 | 0.8; T = 1 | 2
answer: 2/T*tan(w*pi/2)
tolerance: 0.5%

## Prewarp {w}π with T = {T}?

::: misses
- [any] $\frac{2}{T}\tan(\omega/2)$.
:::
:::

::: check
given: a = 300 | 3000; T = 0.1 | 0.4
answer: exp(-a*T/1000)
tolerance: 0.5%

## Impulse-invariant pole for s = −{a} rad/s, T = {T} ms?

::: misses
- [any] $e^{sT}$.
:::
:::

::: check
given: W = 1 | 10; T = 1 | 0.1
answer: 2*atan(W*T/2)/pi
tolerance: 0.5%

## Bilinear image of {W} rad/s with T = {T}, in units of π?

::: misses
- [any] $2\arctan(\Omega T/2)/\pi$.
:::
:::
:::
