Discrete Mathematics
Z-Transform
Algebra for sampled signals
The Z-transform converts a discrete-time sequence x[n] into a function X(z) of a complex variable z. It is the discrete-domain analogue of the Laplace transform and the working tool behind digital filter design and difference-equation solving.
- Bilateral definitionX(z) = ∑_{n=−∞}^∞ x[n] z^(−n)
- Unilateral definitionX(z) = ∑_{n=0}^∞ x[n] z^(−n)
- Variablez = re^(iω), complex
- Time-shift rulex[n − k] ⇄ z^(−k) X(z)
- Stability testAll poles inside |z| = 1
- Used inDigital filters, DSP, control of sampled systems, generating functions
Watch the 60-second explainer
A condensed visual walkthrough — narrated, captioned, under a minute.
The definition
For a discrete sequence x[n], the Z-transform is the formal power series:
X(z) = Z{x[n]} = ∑_{n=−∞}^∞ x[n] · z^(−n)
The variable z is complex. Each sample x[n] is weighted by z^(−n); negative-time samples carry positive powers of z, positive-time samples carry negative powers. The series converges only for z in some annulus — the region of convergence.
For causal signals (x[n] = 0 for n < 0), the bilateral and unilateral forms agree, and the ROC is the exterior of some disk |z| > r. The constant r is the magnitude of the largest pole.
Think of z^(−1) as a unit-delay operator: multiplying X(z) by z^(−1) corresponds to shifting the sequence one sample later. That single observation reduces difference equations to algebra.
Why it linearises difference equations
The shift property is the engine. If the Z-transform of x[n] is X(z), then:
Z{x[n − 1]} = z^(−1) X(z) + x[−1] (unilateral)
Z{x[n − k]} = z^(−k) X(z) + initial-condition terms
For a causal sequence (x[n] = 0 for n < 0) the initial-condition terms vanish, leaving the clean rule x[n − k] ⇄ z^(−k) X(z). A linear difference equation:
y[n] − a₁ y[n−1] − ... − aₚ y[n−p] = b₀ x[n] + b₁ x[n−1] + ... + bq x[n−q]
becomes a polynomial equation in z. The transfer function H(z) = Y(z)/X(z) is the rational function:
H(z) = (b₀ + b₁ z^(−1) + ... + bq z^(−q)) / (1 − a₁ z^(−1) − ... − aₚ z^(−p))
Filter design is the inverse problem: choose the coefficients aₖ, bₖ so that H(z) has the right shape on the unit circle.
Transform-pair table
| x[n] (assumed zero for n < 0) | X(z) | Region of convergence |
|---|---|---|
| δ[n] (unit impulse) | 1 | all z |
| 1, n ≥ 0 (unit step u[n]) | z / (z − 1) | |z| > 1 |
| aⁿ, n ≥ 0 | z / (z − a) | |z| > |a| |
| n, n ≥ 0 | z / (z − 1)² | |z| > 1 |
| n · aⁿ, n ≥ 0 | a z / (z − a)² | |z| > |a| |
| cos(ω₀ n), n ≥ 0 | z(z − cos ω₀) / (z² − 2 z cos ω₀ + 1) | |z| > 1 |
| sin(ω₀ n), n ≥ 0 | z sin ω₀ / (z² − 2 z cos ω₀ + 1) | |z| > 1 |
| aⁿ cos(ω₀ n), n ≥ 0 | z(z − a cos ω₀) / (z² − 2 a z cos ω₀ + a²) | |z| > |a| |
Two derivations worth stepping through.
Z{1} = z/(z − 1). For x[n] = 1 (n ≥ 0), the series is a geometric one:
X(z) = ∑_{n=0}^∞ z^(−n) = 1 + z^(−1) + z^(−2) + ... = 1 / (1 − z^(−1)) = z / (z − 1)
The geometric series converges only when |z^(−1)| < 1, i.e. |z| > 1. The pole at z = 1 sits exactly on the unit circle — the discrete analogue of an integrator, which has a Laplace pole at s = 0.
Z{aⁿ} = z/(z − a). By the same argument:
X(z) = ∑_{n=0}^∞ aⁿ · z^(−n) = ∑_{n=0}^∞ (a/z)ⁿ = 1 / (1 − a/z) = z / (z − a)
convergent for |a/z| < 1, i.e. |z| > |a|. The location of the pole at z = a is exactly the geometric ratio of the sequence, and its magnitude relative to 1 decides whether the sequence decays, oscillates, or blows up.
Solving a difference equation
Take the recurrence y[n] − ½ y[n − 1] = x[n], with x[n] = δ[n] (unit impulse) and y[−1] = 0. The output is the impulse response h[n].
Take Z-transforms of both sides, using the shift property and y[−1] = 0:
Y(z) − ½ z^(−1) Y(z) = X(z) = 1
(1 − ½ z^(−1)) Y(z) = 1
Y(z) = 1 / (1 − ½ z^(−1)) = z / (z − ½)
From the table this is Z{(½)ⁿ}, so y[n] = (½)ⁿ for n ≥ 0. The impulse response decays geometrically — exactly what you'd guess by iterating the recurrence by hand, but obtained algebraically.
Z-Transform vs Laplace vs DTFT
| Z-Transform | Laplace | DTFT | |
|---|---|---|---|
| Domain | Discrete time, n ∈ ℤ | Continuous time, t ≥ 0 (one-sided) | Discrete time, n ∈ ℤ |
| Variable | z = re^(iω), complex | s = σ + iω, complex | ω, real |
| Definition | ∑ x[n] z^(−n) | ∫₀^∞ f(t) e^(−st) dt | ∑ x[n] e^(−iωn) |
| Stability boundary | Unit circle |z| = 1 | Imaginary axis Re(s) = 0 | n/a (assumes stable) |
| Stable poles | |z| < 1 | Re(s) < 0 | n/a |
| Reduction | z = e^(iω) → DTFT | s = iω → Fourier | — |
| Handles initial conditions | Yes (unilateral form) | Yes | No |
| Typical use | Digital filters, sampled control | Continuous control, ODEs | Spectrum of a discrete signal |
The mapping z = e^(sT) (where T is the sampling period) connects the s-plane to the z-plane. Stable left-half-plane Laplace poles wrap into the unit disk; the imaginary s-axis maps onto the unit circle, which is why discrete-time frequency analysis lives on |z| = 1. Evaluating X(z) on the unit circle gives the DTFT — the discrete-time spectrum.
Operational properties
| Property | Time domain | Z-domain |
|---|---|---|
| Linearity | a x[n] + b y[n] | a X(z) + b Y(z) |
| Time shift (k ≥ 0, causal) | x[n − k] | z^(−k) X(z) |
| Time advance | x[n + 1] | z X(z) − z x[0] |
| Multiplication by aⁿ | aⁿ x[n] | X(z/a) |
| Multiplication by n | n x[n] | −z dX(z)/dz |
| Convolution | (x ∗ y)[n] = ∑_k x[k] y[n−k] | X(z) · Y(z) |
| Final value | lim_{n→∞} x[n] | lim_{z→1} (z − 1) X(z) |
| Initial value | x[0] | lim_{z→∞} X(z) |
The convolution-to-multiplication rule again does the heavy lifting. Filtering a signal by an FIR filter of length M takes O(NM) operations directly; equivalently, one product Y(z) = H(z)X(z) — used together with FFT for long signals to drop the cost to O(N log N).
Where the Z-transform shows up
- Digital filter design. An IIR filter is specified by its rational transfer function H(z). Lowpass, highpass, bandpass, and notch filters are designed by placing poles inside the unit circle (for stability) and zeros on the unit circle (to attenuate specific frequencies). MP3 encoders, telephone codecs, equalizers, and noise-cancelling headphones are all just careful pole-zero placements.
- Control of sampled-data systems. A continuous plant controlled by a digital computer is analysed in the z-plane: discretise the plant via z = e^(sT), design a controller with poles inside the unit circle, then implement it as a difference equation. Aircraft autopilots and chemical-process controllers run on this loop.
- Solving recurrences. Probability problems with discrete state, like the gambler's ruin or random walks on a graph, often reduce to linear recurrences. The Z-transform produces closed-form solutions in the same way Laplace produces closed-form ODE solutions.
- Generating functions. A combinatorial generating function ∑ aₙ xⁿ is just the Z-transform with z = 1/x. Counting problems — Fibonacci, Catalan, partitions — are routinely solved by reading off coefficients of a rational generating function, which is identical to inverting a Z-transform by partial fractions.
Common mistakes
- Confusing Z-transform poles with Laplace poles. Stability for Laplace is Re(s) < 0; for Z it's |z| < 1. The mapping z = e^(sT) takes the LHP into the unit disk, but the test conditions look completely different. Always check which transform you're working in.
- Ignoring the region of convergence. Two different sequences can produce the same algebraic X(z) — a right-sided one and a left-sided one — distinguished only by the ROC. For one-sided causal signals you can usually skip this, but for general analysis the ROC is essential.
- Treating z^(−1) as just notation. z^(−1) is the unit-delay operator and obeys algebra. The expression (1 − ½ z^(−1)) Y(z) literally means y[n] − ½ y[n−1]; mixing positive and negative powers without keeping that interpretation in mind leads to sign errors.
- Using Z directly on continuous-time signals. The Z-transform expects a sequence. Apply it to f(t) without sampling first and the result is not what you want; always sample at intervals T satisfying the Nyquist criterion.
- Forgetting initial-condition corrections in the unilateral form. Z{x[n + 1]} = z X(z) − z x[0], not just z X(z). Drop the x[0] term and your transient response will be wrong.
Frequently asked questions
What is the Z-transform in plain terms?
It's the generating function of a sequence dressed up for signal processing. For a sequence x[n], the Z-transform is X(z) = ∑ x[n] z^(−n). Each term encodes one sample, and z^(−1) plays the role of a unit delay. Properties of x[n] become algebra on X(z).
How is the Z-transform related to the Laplace transform?
Sample a continuous signal at intervals T. The Laplace transform of the sampled signal is the Z-transform of the sample sequence with the substitution z = e^(sT). Stable poles in the s-plane (Re(s) < 0) map to poles inside the unit circle |z| < 1. The unit circle |z| = 1 is the discrete analogue of the imaginary axis, and gives the discrete-time Fourier transform.
What is the region of convergence for a Z-transform?
The set of z where the series ∑ x[n] z^(−n) converges. For a right-sided sequence (x[n] = 0 for n < 0), the ROC is the exterior of a disk |z| > r. For a left-sided sequence it's the interior. For a two-sided signal it's an annulus. The ROC must include the unit circle for a stable system.
What's the difference between the unilateral and bilateral Z-transform?
The unilateral version sums from n = 0 and handles initial conditions, the way the one-sided Laplace transform does for ODEs. The bilateral version sums from n = −∞ to ∞ and is used in DSP theory where signals need not be causal. Engineers solving difference equations use the unilateral one; theorists use the bilateral.
How do filter poles and zeros relate to behaviour?
A pole inside the unit circle means a stable, decaying mode; on the circle, sustained oscillation; outside, exponential blow-up. Zeros on the unit circle annihilate specific frequencies — that's how a notch filter eliminates 60 Hz hum from an audio signal. Filter design is largely the art of placing poles and zeros.
Can I use the Z-transform on continuous signals?
Not directly — the Z-transform is for sequences. To apply it to a continuous signal, sample it first. The choice of sampling period T then matters: aliasing occurs if frequencies above 1/(2T) (the Nyquist rate) are present. The Z-transform of the sampled signal is what controls discrete filter design.