Skip to content

Impulse invariance

Copy an analog filter by sampling its impulse response. Each pole maps by a simple rule, but the gain folds near half the sample rate.

Before this20.2 · 6 more
Chapter 20 · Lesson 3 of 6

First, the picture

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.

analog poles
−4443 ± 4443j rad/s
digital poles
not yet
0.00 / 11.00 s
Describe this picture

Two panels for an order-2 Butterworth with fc=1f_c=1 kHz, sampled at fs=8f_s=8 kHz: h[n]=Ts hc(nTs)h[n]=T_s\,h_c(nT_s). The time panel plots Ts hc(t)T_s\,h_c(t) against time from 0 to 1.5 ms: the analog curve is solid, and the samples are stems with dot heads at t=nTst=nT_s. 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, n=0n=0 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 epTse^{pT_s}, and each analog pole maps by z=esTsz=e^{sT_s}, 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 ω\omega (rad/s), digital frequency is Ω\Omega (rad/sample); Oppenheim and Schafer use the opposite letters.

I write the analog filter’s impulse response hc(t)h_c(t) and its transfer function Hc(s)H_c(s). The subscript c means continuous time, as it does for a sampled signal xc(t)x_c(t). The impulse-invariant filter takes one sample every TsT_s seconds and scales it by TsT_s:

h[n]=Ts hc(nTs).h[n]=T_s\,h_c(nT_s).

Why the factor TsT_s? The gain at 0 Hz is the area under hc(t)h_c(t) for the analog filter and the sum of h[n]h[n] for the digital one. Samples spaced TsT_s apart, each times TsT_s, add up to nearly that area, so the two gains stay close.

Now split Hc(s)H_c(s) into one piece per pole, as in Properties and the inverse Laplace transform (9.2). This works when HcH_c has more poles than zeros, as every Butterworth filter does. Each piece is one exponential:

Hc(s)=∑krks−pk,hc(t)=∑krk epkt,t≥0.\begin{aligned} H_c(s)&=\sum_k\frac{r_k}{s-p_k},\\ h_c(t)&=\sum_kr_k\,e^{p_kt},\qquad t\ge0. \end{aligned}

Sampling at t=nTst=nT_s turns epknTse^{p_knT_s} into (epkTs)n\big(e^{p_kT_s}\big)^n, so every piece becomes a geometric sequence:

h[n]=Ts∑krk(epkTs)n,n≥0.h[n]=T_s\sum_kr_k\big(e^{p_kT_s}\big)^n,\qquad n\ge0.

A geometric impulse response is one pole (Properties of LTI systems, 5.4). Summing its geometric series (Difference equations, 6.1) gave the pair anu[n]↔1/(1−az−1)a^nu[n]\leftrightarrow1/(1-az^{-1}) of The z-transform (16.1). One piece at a time, that gives

H(z)=Ts∑krk1−epkTsz−1.H(z)=T_s\sum_k\frac{r_k}{1-e^{p_kT_s}z^{-1}}.

Each analog pole pkp_k becomes the digital pole epkTse^{p_kT_s}. That is 16.1’s map from the s-plane to the z-plane, z=esTsz=e^{sT_s}.

Let’s try it on one filter: the order-2 Butterworth of Analog prototype filters (20.1), with fc=1f_c=1 kHz, sampled at fs=8f_s=8 kHz. So ωc=2π⋅1000=6283.2\omega_c=2\pi\cdot1000=6283.2 rad/s and Ts=0.125T_s=0.125 ms. Its two poles sit on the half-circle of radius ωc\omega_c, at ±135°\pm135°:

p1,2=ωc e±j3π/4=−4442.9±4442.9j rad/s.\begin{aligned} p_{1,2}&=\omega_c\,e^{\pm j3\pi/4}\\ &=-4442.9\pm4442.9j\ \text{rad/s}. \end{aligned}

The transfer function is Hc(s)=ωc2/((s−p1)(s−p2))H_c(s)=\omega_c^2/\big((s-p_1)(s-p_2)\big), which has gain 1 at s=0s=0 because p1p2=ωc2p_1p_2=\omega_c^2. The cover-up rule gives r1=ωc2/(p1−p2)=ωc2/(j2 ωc)r_1=\omega_c^2/(p_1-p_2)=\omega_c^2/(j\sqrt2\,\omega_c). That is −jωc/2=−4442.9j-j\omega_c/\sqrt2=-4442.9j, and the lower pole has the mirror weight r2=+4442.9jr_2=+4442.9j.

9.2’s mirror pair adds the two exponentials into a damped sine:

hc(t)=2 ωc e−ωct/2sin⁡ ⁣(ωct/2).h_c(t)=\sqrt2\,\omega_c\,e^{-\omega_ct/\sqrt2}\sin\!\big(\omega_ct/\sqrt2\big).

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 ωcTs/2\omega_cT_s/\sqrt2 in degrees: the analog pole’s spin rate times one sample period. Their distance from 0, 0.574, is e−ωcTs/2e^{-\omega_cT_s/\sqrt2}: the decay over one sample period.

The poles follow z=esTsz=e^{sT_s}. 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

H(z)=b1z−11+a1z−1+a2z−2,H(z)=\frac{b_1z^{-1}}{1+a_1z^{-1}+a_2z^{-2}},

with 6.1’s coefficient names: b1=0.336071b_1=0.336071, a1=−0.975239a_1=-0.975239 and a2=0.329322a_2=0.329322.

The weights cancel in the constant term, r1+r2=0r_1+r_2=0, so h[0]=0h[0]=0, just as hc(0)=0h_c(0)=0. In powers of zz it reads b1z/(z2+a1z+a2)b_1z/(z^2+a_1z+a_2), so it has a zero at z=0z=0, 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 y[n]=a y[n−1]+(1−a) x[n]y[n]=a\,{y[n-1]}+(1-a)\,x[n] with a=e−Ts/RCa=e^{-T_s/RC}. The circuit’s impulse response is 1RCe−t/RC\tfrac1{RC}e^{-t/RC} (Frequency response and Bode plots, 8.4): one pole at −1/RC-1/RC with weight 1/RC1/RC.

Impulse invariance turns it into

H(z)=Ts/RC1−a z−1,a=e−Ts/RC.H(z)=\frac{T_s/RC}{1-a\,z^{-1}},\qquad a=e^{-T_s/RC}.

The pole is 6.2’s aa, by the same rule. Only the factor on top differs: 6.2 has 1−a1-a where impulse invariance has Ts/RCT_s/RC. 6.2 matched the circuit’s step response at the end of each interval, a variant called step invariance.

For 6.2’s RC=1RC=1 s and Ts=0.5T_s=0.5 s the two factors are 0.393 and 0.5. They agree when TsT_s is small next to RCRC.

The maths behind it · matrix exponentials

Sampling epte^{pt} every TsT_s turns an analog state-space matrix A\mathbf{A} into the discrete one eATse^{\mathbf{A}T_s}, the matrix exponential. Its eigenvalues are epkTse^{p_kT_s}, 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 fsf_s.

10.2’s copies carried a factor 1/Ts1/T_s, and the TsT_s in h[n]=Ts hc(nTs)h[n]=T_s\,h_c(nT_s) cancels it. With ωs=2πfs\omega_s=2\pi f_s,

H(ejΩ)=∑k=−∞∞Hc(j(ω−kωs)),Ω=ωTs.\begin{aligned} H(e^{j\Omega})&=\sum_{k=-\infty}^{\infty}H_c\big(j(\omega-k\omega_s)\big),\\ \Omega&=\omega T_s. \end{aligned}

So the digital response at a frequency is the analog response there, plus the analog response at every frequency a multiple of fsf_s away. The copy centred at fsf_s reaches down into 0 to fs/2f_s/2. It carries the analog gain from above fs/2f_s/2, mirrored about fs/2f_s/2.

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 fs/2f_s/2, so the analog gain at infinity lands at fs/2f_s/2. For a Butterworth that gain is 0: the order-2 bilinear design has a double zero at z=−1z=-1. 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.

cutoff f_c
1000 Hz
invariance, 4 kHz
not yet
bilinear, 4 kHz
not yet
0.00 / 13.00 s
Describe this picture

One panel for an order-2 Butterworth at fs=8f_s=8 kHz: the analog filter, its impulse-invariant copy and its bilinear copy, pre-warped to the same fcf_c. 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 fcf_c. The readouts are the cutoff fcf_c 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 fc=1f_c=1 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 fcf_c 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 fcf_c 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 fs/2f_s/2. That means low-pass and band-pass filters, at a high enough fsf_s. A high-pass or band-stop filter is never small at fs/2f_s/2, 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 H(z)H(z) by its gain at 0 Hz, which is its value at z=1z=1.

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 −4442.9±4442.9j-4442.9\pm4442.9j rad/s, with weights ∓4442.9j\mp4442.9j, which is ∓jωc/2\mp j\omega_c/\sqrt2. Over one sample period the spin turns 4442.9⋅0.000125=0.55544442.9\cdot0.000125=0.5554 rad, which is 31.82°, and the decay shrinks the size by e−0.5554=0.5739e^{-0.5554}=0.5739. So the digital poles are 0.5739∠±31.82°, or 0.4876±0.3026j0.4876\pm0.3026j.

The samples are a damped sine, h[n]=1.1107 (0.5739)nsin⁡(0.5554 n)h[n]=1.1107\,(0.5739)^n\sin(0.5554\,n), because Ts2 ωc=1.1107T_s\sqrt2\,\omega_c=1.1107. 16.1’s damped-sine pair, with radius 0.5739 and angle 31.82°, gives the coefficients of H(z)H(z):

b1=1.1107⋅0.5739sin⁡31.82°=0.336071,a1=−2⋅0.5739cos⁡31.82°=−0.975239,a2=0.57392=0.329322.\begin{aligned} b_1&=1.1107\cdot0.5739\sin31.82°\\ &=0.336071,\\ a_1&=-2\cdot0.5739\cos31.82°\\ &=-0.975239,\\ a_2&=0.5739^2=0.329322. \end{aligned}

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 epkTse^{p_kT_s}. The same map links the two kinds of time-series model, and the same folding appears in their sampled spectra.

Reference card

QuantityFormulaNotes
Impulse invarianceh[n]=Ts hc(nTs)h[n]=T_s\,h_c(nT_s)copies the impulse response
From partial fractionsH(z)=Ts∑krk1−epkTsz−1H(z)=T_s\sum_k\dfrac{r_k}{1-e^{p_kT_s}z^{-1}}poles map by z=esTsz=e^{sT_s}; zeros follow no simple rule
Frequency responseH(ejΩ)=∑kHc(j(ω−kωs))H(e^{j\Omega})=\sum_kH_c\big(j(\omega-k\omega_s)\big)analog response plus copies every fsf_s, added: aliasing
Use forlow-pass, band-pass, time-response specsnever high-pass or band-stop
Bilinear insteadwarped but alias-freethe default for gain specs

End of lesson 20.3

Where to go next.

Phasorium
LibraryEvery lesson, in order

Parts

About Phasorium
Look