---
title: Inverse z-transforms and system functions
heading: Partial fractions with repeated and complex poles, power-series inversion, rational system functions from difference equations, and reading a system's behavior from its poles
eyebrow: S7 · Lesson 3 · Inverse z-transforms and system functions
xp: 50
---

::: hook
Any system built from adders, multipliers and delays has a rational system function, a ratio of polynomials in $z^{-1}$, and its whole behavior is written in the roots of those polynomials. Inverting the transform turns the poles back into the time-domain pieces they stand for: a real pole becomes a decaying exponential, a pair of complex poles a decaying sinusoid, a repeated pole a ramp times an exponential. This lesson builds the inversion machinery for every case that occurs in practice, so that a pole–zero plot can be read as fluently as a waveform.
:::

::: play
- The impulse response of a two-pole resonator, $H(z) = \frac{1}{1 - 2r\cos\theta\,z^{-1} + r^2z^{-2}}$, with poles at $re^{\pm j\theta}$: $h[n] = r^n\frac{\sin((n + 1)\theta)}{\sin\theta}u[n]$.
- θ sets the oscillation, one cycle every 2π/θ samples; r sets the decay, falling to 1% after ln 0.01/ln r samples.
- Move r toward 1 and the ringing lasts longer; past 1 the system is unstable and the response grows.
:::
:::

```sim plot
view: graph
x: n = 0..40
y: h = -2..2
slider: r = 0.5..1.02 = 0.9
slider: t = 0.1..3 = 1.047
plot: r^n*sin((n + 1)*t)/sin(t) | stems | label: h[n]
readout: samples per cycle = 2*pi/t
readout: samples to fall to 1% = ln(0.01)/ln(r)
```

::: predict
## A causal system has a double pole at z = 0.5 and no other poles. What does its impulse response look like?

- [ ] A pure decaying exponential, 0.5ⁿ
- [x] A ramp times a decaying exponential, (n + 1)·0.5ⁿ
- [ ] A decaying sinusoid
- [ ] It's unstable because the pole is repeated

::: reveal
A ramp times an exponential: $\frac{1}{(1 - 0.5z^{-1})^2}$ inverts to $(n + 1)(0.5)^nu[n]$, which rises at first (1, 1, 0.75, 0.5, …) before the exponential wins. A repeated pole inside the unit circle is still stable; repeated poles on the unit circle are not, since they give a response that grows like n.
:::
:::

::: nameit
## Rational system functions

A difference equation $\sum_{k=0}^{N}a_ky[n - k] = \sum_{k=0}^{M}b_kx[n - k]$ gives

$$H(z) = \frac{\sum_{k=0}^{M}b_kz^{-k}}{\sum_{k=0}^{N}a_kz^{-k}} = \frac{b_0}{a_0}\frac{\prod(1 - c_kz^{-1})}{\prod(1 - d_kz^{-1})}$$

with zeros $c_k$ and poles $d_k$. **FIR** systems (N = 0) have all their poles at the origin and are always stable; **IIR** systems have poles elsewhere.

## Inversion by partial fractions

- If M ≥ N, divide first to extract a polynomial in $z^{-1}$ (a finite sequence).
- Simple poles: $\frac{A_k}{1 - d_kz^{-1}}$ with $A_k = (1 - d_kz^{-1})X(z)|_{z = d_k}$, each giving $A_kd_k^nu[n]$ (or $-A_kd_k^nu[-n-1]$, by the ROC).
- **Complex-conjugate pair** $re^{\pm j\theta}$: the two terms combine into $2|A|r^n\cos(\theta n + \angle A)u[n]$.
- **Repeated poles**: $\frac{1}{(1 - az^{-1})^2} \leftrightarrow (n + 1)a^nu[n]$ and $\frac{az^{-1}}{(1 - az^{-1})^2} \leftrightarrow na^nu[n]$.

## Inversion by power series

Long division of the numerator by the denominator, in powers of $z^{-1}$ for a causal sequence, gives x[0], x[1], … one at a time. It's exactly the difference equation run on an impulse.

## Reading poles

A pole at radius r decays by r per sample; at angle θ it oscillates with period 2π/θ samples. The second-order section $1 + a_1z^{-1} + a_2z^{-2}$ has $a_1 = -2r\cos\theta$, $a_2 = r^2$. Zeros on the unit circle make exact nulls: the comb $1 - z^{-N}$ has zeros at $e^{j2\pi k/N}$.
:::

::: example
## Find h[n] for $H(z) = \frac{1 + z^{-1}}{1 - 0.9z^{-1} + 0.81z^{-2}}$ in closed form, and check the first samples.

::: solution
1. **Poles.** The poles are $0.9e^{\pm j\pi/3}$, since
   $$\begin{aligned} 2(0.9)\cos 60° &= 0.9 \\ 0.9^2 &= 0.81 \end{aligned}$$
2. **Residue.** At $p = 0.9e^{j\pi/3}$:
   $$\begin{aligned} A &= \frac{1 + p^{-1}}{1 - p^*/p} \\ &= 1.056\angle{-61.7°} \end{aligned}$$
3. **Closed form.** The two conjugate terms add to a real cosine:
   $$\begin{aligned} h[n] &= 2.112(0.9)^n \\ &\quad \times \cos\left(\frac{\pi}{3}n - 61.7°\right) \end{aligned}$$
4. **First samples.** That gives 1, 1.9, 0.9, −0.729, −1.385.
5. **Check.** Running the recursion on an impulse gives the same:
   $$\begin{aligned} y[n] &= 0.9y[n-1] \\ &\quad - 0.81y[n-2] \\ &\quad + x[n] + x[n-1] \end{aligned}$$

**Answer:** $h[n] = 2.112(0.9)^n\cos(\frac{\pi}{3}n - 61.7°)$, starting 1, 1.9, 0.9, −0.729, −1.385, as the recursion confirms.
:::
:::

::: example
## Invert $X(z) = \frac{1}{(1 - 0.5z^{-1})^2}$ for a causal sequence, and find x[3].

::: solution
1. **Inverse transform.**
   $$x[n] = (n + 1)(0.5)^nu[n]$$
2. **x[3].**
   $$\begin{aligned} x[3] &= \frac{4}{8} \\ &= 0.5 \end{aligned}$$
3. **Check by long division.**
   $$\begin{aligned} X(z) &= (1 - z^{-1} + 0.25z^{-2})^{-1} \\ &= 1 + z^{-1} + 0.75z^{-2} \\ &\quad + 0.5z^{-3} + \cdots \end{aligned}$$

**Answer:** $x[n] = (n + 1)(0.5)^nu[n]$, so x[3] = 0.5.
:::
:::

::: example
## Design a resonator with poles at radius 0.95 and angle π/4, running at 8 kHz. What are its coefficients, ringing frequency and decay time to 1%?

::: solution
1. **Coefficients.**
   $$\begin{aligned} a_1 &= -2(0.95)\cos(\pi/4) \\ &= -1.344 \end{aligned}$$
   $$\begin{aligned} a_2 &= 0.95^2 \\ &= 0.9025 \end{aligned}$$
2. **Ringing frequency.** The pole angle π/4 is a period of 8 samples, 1 kHz at 8 kHz.
3. **Decay time.** The ringing decays as $0.95^n$, reaching 1% after
   $$\begin{aligned} n &= \frac{\ln 0.01}{\ln 0.95} \\ &= 90\ \text{samples} \end{aligned}$$
   which is 11.2 ms.
4. **A sharper resonator.** Moving the poles to r = 0.99 would ring five times longer and sharpen the peak accordingly.

**Answer:** $a_1 = -1.344$ and $a_2 = 0.9025$; it rings at 1 kHz and decays to 1% in 90 samples, 11.2 ms.
:::
:::

::: check
given: r = 0.7 | 0.9 | 0.95; t = 0.5 | 1 | 2; n = 2 | 5 | 9
answer: r^n*sin((n + 1)*t)/sin(t)
tolerance: 0.5%

## A causal resonator $1/(1 - 2r\cos\theta\,z^{-1} + r^2z^{-2})$ has r = {r} and θ = {t} rad. What's h[{n}]?

::: right
Right. $r^n\sin((n + 1)\theta)/\sin\theta$ = {answer}.
:::

::: misses
- [r^n*cos(n*t)] The impulse response of this all-pole section is $r^n\sin((n + 1)\theta)/\sin\theta$.
- [any] Not yet. Combine the two complex-pole terms.
:::
:::

::: check
given: a = 0.4 | 0.6 | -0.8; n = 2 | 3 | 6
answer: (n + 1)*a^n
tolerance: 0.5%

## What's x[{n}] for the causal inverse of $1/(1 - \given{a}z^{-1})^2$?

::: right
Right. $(n + 1)a^n$ = {answer}.
:::

::: misses
- [n*a^n] That's the inverse of $az^{-1}/(1 - az^{-1})^2$.
- [a^n] A double pole multiplies the exponential by a ramp.
- [any] Not yet. $(n + 1)a^nu[n]$.
:::
:::

::: check
given: r = 0.8 | 0.9 | 0.97; t = 30 | 60 | 120
answer: -2*r*cos(t*pi/180)
tolerance: 0.5%

## A second-order section $1 + a_1z^{-1} + a_2z^{-2}$ has poles at {r}e^{±j{t}°}. What's $a_1$?

::: right
Right. $-2r\cos\theta$ = {answer} (and $a_2 = r^2$).
:::

::: misses
- [2*r*cos(t*pi/180)] With the denominator written $1 + a_1z^{-1} + \cdots$, $a_1 = -(p + p^*) = -2r\cos\theta$.
- [any] Not yet. Expand $(1 - pz^{-1})(1 - p^*z^{-1})$.
:::
:::

::: check
given: r = 0.8 | 0.95 | 0.99
answer: ln(0.01)/ln(r)
tolerance: 0.5%

## A pole at radius {r}: after how many samples has its term decayed to 1%?

::: right
Right. $r^n = 0.01$ at n = {answer}.
:::

::: misses
- [1/(1 - r)] That's a time-constant estimate; solve $r^n = 0.01$.
- [any] Not yet. Solve $r^n = 0.01$.
:::
:::

::: check
given: b = 1 | 2; c = -0.5 | 0.8; a = 0.3 | 0.6; d = -0.2 | 0.1
answer: (b + c)/(1 + a + d)
tolerance: 0.5%

## A stable causal system has $H(z) = \frac{\given{b} + \given{c}z^{-1}}{1 + \given{a}z^{-1} + \given{d}z^{-2}}$. What does its step response settle to?

::: right
Right. The DC gain H(1) = {answer}.
:::

::: misses
- [(b + c)/(1 - a - d)] Substitute z = 1 directly: the signs stay as written.
- [any] Not yet. Evaluate H(z) at z = 1.
:::
:::

::: check
given: N = 4 | 8 | 50; f = 8 | 44.1 | 48
answer: f/N
unit: kHz
tolerance: 0.5%

## The comb filter $1 - z^{-N}$ with N = {N} runs at {f} kHz. What's its lowest nonzero null frequency?

::: right
Right. Zeros at $e^{j2\pi k/N}$, so the first is at $f_s/N$ = {answer} kHz.
:::

::: misses
- [f/(2*N)] The zeros sit at $2\pi k/N$, not $\pi k/N$.
- [any] Not yet. Zeros of $1 - z^{-N}$ are the N-th roots of unity.
:::
:::

::: check
kind: parts
given: r = 0.9 | 0.95 | 0.99; t = 15 | 45 | 120; s = 8 | 44.1

## A resonator has poles at radius {r} and angle {t}° and runs at {s} kHz.

::: part
answer: -2*r*cos(t*pi/180)
tolerance: 0.5%

### What is $a_1$?

::: misses
- [2*r*cos(t*pi/180)] The sign is negative: $a_1 = -2r\cos\theta$.
- [any] $-2r\cos\theta$.
:::
:::

::: part
answer: t/360*s*1000
unit: Hz
tolerance: 0.5%

### At what frequency does it ring?

::: misses
- [any] $(\theta/2\pi)f_s$.
:::
:::

::: part
answer: ln(0.01)/ln(r)/(s*1000)*1000
unit: ms
tolerance: 0.5%

### How long does its ringing take to decay to 1%?

::: misses
- [any] $\ln0.01/\ln r$ samples, divided by $f_s$.
:::
:::
:::

::: check
kind: derivation
vars: r = 0.5..0.99, t = 0.1..3

## A causal resonator $1/(1 + a_1z^{-1} + a_2z^{-2})$ has poles at $re^{\pm jt}$.

::: step
answer: -2*r*cos(t)

### What is $a_1$?
:::

::: step
answer: 2*r*cos(t)

### What is h[1]?
:::

::: step
answer: 4*r^2*cos(t)^2 - r^2

### What is h[2]?
:::

::: right
Right. Running the difference equation on an impulse: h[0] = 1, h[1] = −a₁, h[2] = a₁² − a₂.
:::
:::

::: explain
## Why does a pair of complex-conjugate poles produce a real, oscillating impulse response?

::: model
A real system has real coefficients, so its complex poles come in conjugate pairs, and their partial-fraction residues are conjugates too. Each pole on its own contributes a complex exponential, $Ap^n$, which spirals around the complex plane, shrinking by r and turning by θ every sample. The conjugate pole's term is the mirror image, spiraling the other way. Adding the two cancels the imaginary parts and doubles the real parts, leaving $2|A|r^n\cos(\theta n + \angle A)$: a cosine at the pole angle's frequency, decaying at the pole radius's rate. The angle sets how fast it oscillates and the radius how fast it dies.
:::
:::

::: practice

::: check
given: r = 0.85 | 0.92; t = 0.7 | 1.5; n = 3 | 7
answer: r^n*sin((n + 1)*t)/sin(t)
tolerance: 0.5%

## Resonator h[{n}]: r {r}, θ {t} rad?

::: misses
- [any] $r^n\sin((n + 1)\theta)/\sin\theta$.
:::
:::

::: check
given: a = 0.5 | 0.75; n = 4 | 8
answer: (n + 1)*a^n
tolerance: 0.5%

## Double pole at {a}: x[{n}]?

::: misses
- [any] $(n + 1)a^n$.
:::
:::

::: check
given: r = 0.5 | 0.8 | 0.9 | 0.95 | 0.98 | 0.99
answer: ln(0.01)/ln(r)
tolerance: 0.5%

## Samples to 1% for a pole at radius {r}?

::: misses
- [any] $\ln 0.01/\ln r$.
:::
:::
:::
