Discrete-Time Transfer Functions and Stability
H(z) from difference equations, poles inside the unit circle, inverse transforms with residuez, FIR and IIR filters, and impulse responses from poles
1202 — Fibonacci's rabbits
In Liber Abaci, the Book of Calculation of 1202, Leonardo of Pisa — Fibonacci — poses a puzzle about an idealised population. A newly born pair of rabbits is put in a field; each pair mates at one month old and, from the end of its second month, produces a new pair every month; and rabbits never die. How many pairs will there be in a year (Fibonacci sequence)?
Each month's count is last month's plus the month before's: 1, 1, 2, 3, 5, 8, 13, … The numbers had been described in Indian mathematics as early as 200 BC, by Pingala, in counting the patterns of Sanskrit poetry (Fibonacci sequence).
In this unit's language the rabbits are a filter with feedback, . Its transfer function has a pole at the golden ratio, 1.618 — outside the unit circle — which is why the population explodes.
A linear difference equation, , describes every digital filter. If no past outputs appear (), the impulse response ends after samples: a finite impulse response (FIR) filter, always stable. Feed outputs back and the response can go on for ever: an infinite impulse response (IIR) filter, as sharp as feedback allows — and as risky.
Derivation
From difference equation to H(z)
Transform both sides with the delay rule , starting from rest:
Multiply numerator and denominator by and the poles are the roots of . For the rabbits, , with poles at : and .
💡Stable means inside the unit circle
Each pole contributes to the impulse response, which decays only if . A causal filter is stable if and only if every pole lies strictly inside the unit circle. In this lesson's lab, after 40 samples:
- , poles of radius 0.9: the response has fallen to 0.0066 — stable;
- , poles of radius exactly 1: a sinusoid that never fades — marginally stable, a digital oscillator;
- the rabbits, a pole at 1.618: 102 million pairs — unstable.
💡Inverse transforms by partial fractions
Expand in terms of , each of which inverts to :
For , SciPy's
residuez finds at and at , so : 1, 1.9, 2.21, 2.239, 2.140, … — exactly what lfilter computes sample by sample.📐A 440 Hz resonator
A complex pole pair gives : it rings at , and its envelope shrinks by a factor each sample, falling to after about samples. Put the poles at and, sampled at 8 kHz, the filter rings at 440 Hz — the A above middle C. Its envelope falls to in about 96 samples (12 ms), and its peak is 25.6 Hz wide at −3 dB, close to the estimate Hz: two coefficients set both the pitch and the sharpness.
There from a marvelous instruction in the art of the nine Indian figures, the introduction and knowledge of the art pleased me so much above all else
🕰From Pingala to Pisa
The sequence was counted in India centuries before Fibonacci, in Pingala's work on Sanskrit prosody. Fibonacci himself learned arithmetic as a boy in Bugia, on the North African coast, where his father worked for Pisan merchants; he went on to study the methods of Egypt, Syria, Greece, Sicily and Provence, and judged the Indian numerals superior to them all (Fibonacci sequence; Fibonacci on Wikiquote).
⚠Rounding can move a pole outside
A filter whose poles sit at radius 0.999 is only a thousandth from instability. Store its coefficients with too few bits and the poles move — possibly across the circle. High-order IIR filters are therefore built as cascades of second-order sections, each with its own pair of poles (Lesson 9-3), rather than as one long difference equation.
💡Where you will use this
Frequency responses read from pole and zero positions are Lesson 8-3. FIR design is Lesson 9-1, IIR design Lesson 9-2, and the arithmetic of second-order sections Lesson 9-3. Digital oscillators with poles on the circle generate the carriers of Unit 10.
📚Further reading
- Oppenheim and Willsky, Signals and Systems, sections 10.6–10.8 — the inverse z-transform and LTI systems described by difference equations.
- Alan V. Oppenheim and Ronald W. Schafer, Discrete-Time Signal Processing (3rd ed., Pearson, 2010), chapters 3 and 5.
- Fibonacci sequence on Wikipedia.
↓But there is a problem
Poles near the circle make peaks; zeros on it make silences. Every frequency response is the play of these points against the circle.
And every ECG machine relies on it: the heart's signal is about a millivolt, and the building's wiring hums at 50 or 60 hertz.