One way to copy an analog filter is to sample its impulse response. Below, the impulse response of an analog filter is drawn and then sampled. Watch where the two digital poles land on the plane at the end.
Sample the analog impulse response
An order-2 Butterworth with f_c = 1 kHz, sampled at f_s = 8 kHz: h[n] = T_s h_c(nT_s).
The analog impulse response of an order-2 Butterworth at 1 kHz, times T_s.
Describe this picture
Two panels for an order-2 Butterworth with kHz, sampled at kHz: . The time panel plots against time from 0 to 1.5 ms: the analog curve is solid, and the samples are stems with dot heads at . The plane has the real part across and the imaginary part up, with the unit circle drawn; the two digital poles are crosses, labelled “0.574∠31.8°” and “0.574∠−31.8°”. The readouts are the analog poles, −4443 ± 4443j rad/s throughout, and the digital poles, which read “not yet” until the poles appear. There is no control.
The clip lasts 11 s, with a blank caption while the curve draws. It opens on empty axes, and the analog curve draws. At 3.25 s the caption notes that the poles, −4443 ± 4443j rad/s, are a decay and a spin at the same rate. Then the stems drop one by one, to 11, one sample every 0.125 ms. At 7.5 s the samples, 0, 0.336, 0.328, 0.209, 0.096, …, sit exactly on the curve. Last, the two poles appear on the plane, and the digital readout shows 0.574∠±31.8°: the samples are the impulse response of a recursive filter with poles , and each analog pole maps by , as in 16.1.
Sample the analog impulse response
In IIR design by the bilinear transform (20.2) we borrowed an analog filter and bent its frequency axis onto the unit circle. Here is a second way to borrow one. It starts from time instead of frequency: take the analog filter’s impulse response and sample it.
As in 20.2, analog frequency is (rad/s), digital frequency is (rad/sample); Oppenheim and Schafer use the opposite letters.
I write the analog filter’s impulse response and its transfer function . The subscript c means continuous time, as it does for a sampled signal . The impulse-invariant filter takes one sample every seconds and scales it by :
Why the factor ? The gain at 0 Hz is the area under for the analog filter and the sum of for the digital one. Samples spaced apart, each times , add up to nearly that area, so the two gains stay close.
Now split into one piece per pole, as in Properties and the inverse Laplace transform (9.2). This works when has more poles than zeros, as every Butterworth filter does. Each piece is one exponential:
Sampling at turns into , so every piece becomes a geometric sequence:
A geometric impulse response is one pole (Properties of LTI systems, 5.4). Summing its geometric series (Difference equations, 6.1) gave the pair of The z-transform (16.1). One piece at a time, that gives
Each analog pole becomes the digital pole . That is 16.1’s map from the s-plane to the z-plane, .
Let’s try it on one filter: the order-2 Butterworth of Analog prototype filters (20.1), with kHz, sampled at kHz. So rad/s and ms. Its two poles sit on the half-circle of radius , at :
The transfer function is , which has gain 1 at because . The cover-up rule gives . That is , and the lower pole has the mirror weight .
9.2’s mirror pair adds the two exponentials into a damped sine:
The picture at the top of the page samples this curve. Think of a flip-book of a falling ball. Every page shows the ball where it really was at that moment; the pages only skip the moments in between.
Notice the angle. The digital poles sit at 31.8°, and that is in degrees: the analog pole’s spin rate times one sample period. Their distance from 0, 0.574, is : the decay over one sample period.
The poles follow . The zeros do not follow a simple rule, because they come out of adding the pieces. The analog filter has no finite zeros. Adding the two digital pieces over a common denominator gives
with 6.1’s coefficient names: , and .
The weights cancel in the constant term, , so , just as . In powers of it reads , so it has a zero at , which no analog zero maps to.
You have met this design once already. In Differential equations and analog systems (6.2), the RC circuit’s discrete copy was with . The circuit’s impulse response is (Frequency response and Bode plots, 8.4): one pole at with weight .
Impulse invariance turns it into
The pole is 6.2’s , by the same rule. Only the factor on top differs: 6.2 has where impulse invariance has . 6.2 matched the circuit’s step response at the end of each interval, a variant called step invariance.
For 6.2’s s and s the two factors are 0.393 and 0.5. They agree when is small next to .
The maths behind it · matrix exponentials
Sampling every turns an analog state-space matrix into the discrete one , the matrix exponential. Its eigenvalues are , the mapped poles. Impulse invariance is the scalar case, one pole per partial fraction.
The analog gain, folded
Impulse invariance copies the impulse response at the sampling instants. What does that do to the gain? The impulse response is a signal like any other. By The sampling theorem (10.2), its samples have a spectrum made of copies of the analog one, one at every multiple of .
10.2’s copies carried a factor , and the in cancels it. With ,
So the digital response at a frequency is the analog response there, plus the analog response at every frequency a multiple of away. The copy centred at reaches down into 0 to . It carries the analog gain from above , mirrored about .
I call this the folding of the frequency response. It is 10.2’s aliasing, applied to a frequency response.
Think of the analog gain written on a long strip of paper, folded back and forth into a short box. What was written past the fold lands on top of what is already there. The copies add as complex numbers, with their phases, not as plain gains.
The bilinear design of 20.2 has no copies. It squeezes the whole analog frequency axis onto 0 to , so the analog gain at infinity lands at . For a Butterworth that gain is 0: the order-2 bilinear design has a double zero at . Below, the analog filter and its two digital copies are drawn together; watch the gain at 4 kHz as the cutoff rises.
The analog gain, folded
Order-2 Butterworth: the analog filter, its impulse-invariant copy and its bilinear copy (pre-warped to the same f_c), at f_s = 8 kHz.
f_c = 1 kHz. The analog gain falls to −24.1 dB at 4 kHz and keeps falling beyond.
Describe this picture
One panel for an order-2 Butterworth at kHz: the analog filter, its impulse-invariant copy and its bilinear copy, pre-warped to the same . It plots the gain from −60 to 5 dB against frequency from 0 to 4000 Hz. The analog curve is thin and dashed, the impulse-invariant one solid and the bilinear one dotted, and a dotted vertical line marks . The readouts are the cutoff in hertz, then each copy’s gain at 4 kHz in dB.
The clip lasts 13 s, with a blank caption while the cutoff moves. It opens on the analog curve only, at kHz: the analog gain falls to −24.1 dB at 4 kHz and keeps falling beyond. Then the other two curves draw. At 3.5 s impulse invariance stops at −16.7 dB at 4 kHz, because the analog gain above 4 kHz folds back and adds, while the bilinear filter reaches 0, −∞ dB. At 6.5 s the cutoff is 2 kHz: the folding is worse, −6.6 dB at 4 kHz, and even the gain at 0 Hz is off, −1.9 dB. At the end the cutoff is 3 kHz: the impulse-invariant filter is nearly flat, −4.7 to −3.7 dB everywhere, and reads −4.1 dB at 4 kHz. After the clip the line is a handle named “Cutoff f_c”, from 250 to 3500 Hz in steps of 50 Hz, with a value like “3000 Hz: −4.1 dB at 4 kHz”. The arrow keys move it by 50 Hz, Page Up and Page Down by 500 Hz, and Home and End jump to 250 and 3500 Hz. At 1000, 2000 and 3000 Hz the caption is the clip’s own; elsewhere it reads like “f_c = 500 Hz: impulse invariance −28.4 dB at 4 kHz, the analog filter −36.1 dB.” The position is kept in the link, as fold.fc.
After the clip, drag the dotted line, or use the arrow keys, to move the cutoff yourself. Try 1500 Hz. The impulse-invariant gain at 4 kHz is −10.4 dB, while the analog gain there is −17.1 dB. Now try 3500 Hz: −4.9 dB against the analog −4.3 dB. Here the copies partly cancel, because they add with their phases.
Impulse invariance or the bilinear transform
Impulse invariance copies a time response at the sampling instants, and it keeps frequencies where they were, with no warping. That makes it useful when the impulse or step response is the specification. Control engineers use it that way, and so do people who model an analog circuit’s transient.
It works only for filters whose analog gain is already small above . That means low-pass and band-pass filters, at a high enough . A high-pass or band-stop filter is never small at , so its copies overlap at full strength. For a specification on the gain, the bilinear transform is the default: its frequencies are warped, but nothing folds.
The gain at 0 Hz drifts too, by −0.45 dB for our 1 kHz filter. To fix it, divide by its gain at 0 Hz, which is its value at .
Worked example
Let’s redo the page’s numbers.
1. The order-2 Butterworth at 1 kHz, sampled at 8 kHz. The analog poles are rad/s, with weights , which is . Over one sample period the spin turns rad, which is 31.82°, and the decay shrinks the size by . So the digital poles are 0.5739∠±31.82°, or .
The samples are a damped sine, , because . 16.1’s damped-sine pair, with radius 0.5739 and angle 31.82°, gives the coefficients of :
Its gain is −0.453 dB at 0 Hz, −3.015 dB at 1 kHz and −16.72 dB at 4 kHz, where the analog filter has −24.10 dB.
2. The folding grows with the cutoff. I designed the impulse-invariant filter for eight cutoffs and read its gain at 0 Hz and at 4 kHz. The analog gain at 4 kHz is there for comparison.
| Cutoff (Hz) | Gain at 0 Hz (dB) | Gain at 4 kHz (dB) | Analog gain at 4 kHz (dB) |
|---|---|---|---|
| 250 | −0.03 | −40.3 | −48.2 |
| 500 | −0.11 | −28.4 | −36.1 |
| 1000 | −0.45 | −16.7 | −24.1 |
| 1500 | −1.04 | −10.4 | −17.1 |
| 2000 | −1.90 | −6.6 | −12.3 |
| 2500 | −3.08 | −4.6 | −8.8 |
| 3000 | −4.66 | −4.1 | −6.2 |
| 3500 | −6.73 | −4.9 | −4.3 |
Up to 1 kHz the folded gain at 4 kHz stays more than 16 dB down. At 2 kHz the gain at 0 Hz is already 1.9 dB off. From 2.5 kHz on, the gain at 4 kHz is at most 1.5 dB below the gain at 0 Hz, and from 3 kHz it is above it.
Where you’ll meet this
SciPy’s cont2discrete(system, dt, method='impulse') and MATLAB’s impinvar do this design. Control engineers use it to give a digital model the impulse or step response of an analog plant. Audio programmers use it to copy an analog circuit’s ringing, and to build sounds from sums of decaying sines, one pole pair per sine.
For shapes other than low-pass, see Frequency transformations (20.4). Whether an IIR filter is the right choice at all is Choosing FIR or IIR (20.6).
The maths behind it · sampled autoregressive processes
A continuous-time autoregressive process, sampled at regular times, is an AR process with poles . The same map links the two kinds of time-series model, and the same folding appears in their sampled spectra.
Reference card
| Quantity | Formula | Notes |
|---|---|---|
| Impulse invariance | copies the impulse response | |
| From partial fractions | poles map by ; zeros follow no simple rule | |
| Frequency response | analog response plus copies every , added: aliasing | |
| Use for | low-pass, band-pass, time-response specs | never high-pass or band-stop |
| Bilinear instead | warped but alias-free | the default for gain specs |