Skip to content

4.6 — The Z-Transform

A digital filter does not solve a differential equation. It computes something like

y[n]=0.5\,y[n-1]+0.5\,x[n]

— a difference equation, in which the new output depends on old outputs and current inputs. There are no derivatives anywhere, only delays.

The Z-transform does for difference equations exactly what Laplace did for differential ones: it turns a delay into multiplication by a symbol, and the recursion into algebra.

This is Chapter 4.5's Laplace transform rebuilt for signals that exist only at sample instants, so the sampling ideas of Chapter 4.1 are assumed throughout. The relationship between the two transforms is exact, and section 4 derives it.

1. Definition

\boxed{X(z)=\sum_{n=-\infty}^{\infty}x[n]z^{-n}}

Read aloud: "X of z equals the sum over all n of x-of-n times z to the minus n."

A signal becomes a polynomial in z^{-1}, with the sample values as coefficients. For a causal signal \{x[0],x[1],x[2],\ldots\}:

X(z)=x[0]+x[1]z^{-1}+x[2]z^{-2}+\cdots

Read that literally and the whole transform becomes intuitive: z^{-1} is a one-sample delay. The coefficient of z^{-3} is whatever happened three samples ago. Nothing more mysterious than that.

The region of convergence is the set of z where the sum converges, always an annulus (a ring) centred on the origin. For a causal signal it is everything outside the largest pole; for an anticausal one, everything inside the smallest.

2. The relationship to Laplace

Sample a continuous signal every T_s seconds. Its Laplace transform involves e^{-sT_s} for each sample delay. Define

\boxed{z=e^{sT_s}}

and the two transforms become the same object. That single substitution maps the s-plane onto the z-plane, and the geometry it produces is the reason the Z-transform looks the way it does.

Write s=\sigma+j\omega:

z=e^{(\sigma+j\omega)T_s}=e^{\sigma T_s}e^{j\omega T_s}

so

|z|=e^{\sigma T_s}, \qquad \angle z = \omega T_s

Now read off the consequences:

  • \sigma=0 (the imaginary axis) maps to |z|=1, the unit circle. The frequency axis becomes a circle.
  • \sigma\lt0 (the stable left half-plane) maps to |z|\lt1, inside the circle.
  • \sigma\gt0 maps to outside.

\boxed{\text{A discrete system is stable if and only if every pole lies inside the unit circle.}}

stableunstables-planez = e^(sTs)stableinsideunstableoutsideω = fs/4ω = 0ω = fs/2z-planeThe infinite frequency axis wraps onto a finite circle — which is exactly why sampled signals alias.
How the two planes relate. The whole stable half of the s-plane folds into the interior of the unit circle, and the infinite frequency axis wraps around the circumference — going round once per sampling frequency, which is aliasing seen geometrically.

And note what the wrapping means. As \omega increases from 0, the point e^{j\omega T_s} travels anticlockwise round the circle. At \omega = \pi/T_s — the Nyquist frequency — it reaches -1, half way. At \omega = 2\pi/T_s it is back where it started. Frequencies above the sampling rate simply go round again and land on top of lower ones. That is aliasing, and here it is a geometric fact rather than an accident.

3. The essential pairs

Unit impulse. \delta[n]=\{1,0,0,\ldots\}:

X(z)=1\cdot z^0=1

Unit step. u[n]=\{1,1,1,\ldots\}:

X(z)=\sum_{n=0}^\infty z^{-n}=\frac{1}{1-z^{-1}}=\frac{z}{z-1}

using the geometric series \sum r^n = 1/(1-r) with r=z^{-1}, valid for |z|>1.

Exponential. a^nu[n]:

X(z)=\sum_{n=0}^\infty a^nz^{-n}=\sum(az^{-1})^n=\frac{1}{1-az^{-1}}=\frac{z}{z-a}

for |z|>|a|.

This is the pair to internalise, exactly as 1/(s+a) was in Chapter 4.5. A pole at z=a means a term a^n in the time response.

And it makes stability obvious. a^n grows without limit when |a|>1 and decays when |a|<1. The pole being inside the unit circle is not an abstract criterion — it is literally the condition for a^n to shrink.

SignalTransformPole
\delta[n]1none
u[n]\dfrac{z}{z-1}z=1
a^nu[n]\dfrac{z}{z-a}z=a
n\,u[n]\dfrac{z}{(z-1)^2}double at 1
\cos(\omega_0n)u[n]\dfrac{z(z-\cos\omega_0)}{z^2-2z\cos\omega_0+1}on the circle

4. The properties

Delay. This is the one everything else rests on:

x[n-k] \;\longleftrightarrow\; z^{-k}X(z)

A delay of k samples is multiplication by z^{-k}. That is the whole reason the transform is useful.

Convolution. x[n]*h[n] \leftrightarrow X(z)H(z) — the same theorem for the third time, and the reason FIR filter design works.

Initial and final value.

x[0]=\lim_{z\to\infty}X(z), \qquad x[\infty]=\lim_{z\to1}(z-1)X(z)

Note that the final value theorem uses z\to1, because z=1 is where DC lives — it is the image of s=0 under z=e^{sT_s}.

5. Difference equations to transfer functions

The mechanical procedure, and it is genuinely mechanical.

Take

y[n]=0.5\,y[n-1]+0.5\,x[n]

Transform every term, replacing each k-sample delay by z^{-k}:

Y(z)=0.5z^{-1}Y(z)+0.5X(z)

Collect the Y terms:

Y(z)\left(1-0.5z^{-1}\right)=0.5X(z)

H(z)=\frac{Y(z)}{X(z)}=\frac{0.5}{1-0.5z^{-1}}=\frac{0.5z}{z-0.5}

One pole at z=0.5, inside the unit circle, so stable. Its impulse response, read from the exponential pair, is h[n]=0.5(0.5)^n u[n] — a decaying geometric sequence.

Check that against the difference equation directly. Input \delta[n]: y[0]=0.5, y[1]=0.5(0.5)=0.25, y[2]=0.125 ✓. The transform and the direct computation agree, as they must.

The general form

H(z)=\frac{b_0+b_1z^{-1}+\cdots+b_Mz^{-M}}{1+a_1z^{-1}+\cdots+a_Nz^{-N}}

The b coefficients are the feedforward path — they multiply present and past inputs. The a coefficients are the feedback path — they multiply past outputs. That distinction is the entire FIR-versus-IIR split of Chapter 5.2:

  • No a terms (denominator is 1): a finite impulse response filter. The impulse response is exactly the b list and then stops. Always stable, because there are no poles other than at the origin.
  • Any a term: an infinite impulse response filter. The feedback makes the response go on forever, decaying if the poles are inside the circle and growing if not. Cheaper for a given sharpness, and it can be unstable.

6. Reading the frequency response off the unit circle

Set z=e^{j\omega T_s} — walk around the unit circle — and H(z) becomes the frequency response.

The geometric picture of Chapter 4.5 carries over exactly:

|H(e^{j\omega})|=\frac{\prod\text{distances to zeros}}{\prod\text{distances to poles}}

So: a pole near the unit circle produces a peak at that angle. A zero on the unit circle produces an exact null at that angle.

This makes filter design startlingly direct. Want to remove exactly 50 Hz mains hum from a signal sampled at 1 kHz? Put zeros on the unit circle at the corresponding angle:

\omega = 2\pi\frac{50}{1000}=0.1\pi \text{ radians per sample}

so zeros at z=e^{\pm j0.1\pi}. Then place poles at the same angle but slightly inside, at radius r=0.95, to narrow the notch so it does not remove everything nearby:

H(z)=\frac{(z-e^{j0.1\pi})(z-e^{-j0.1\pi})}{(z-0.95e^{j0.1\pi})(z-0.95e^{-j0.1\pi})}

Expanding the numerator: z^2 - 2\cos(0.1\pi)z+1 = z^2-1.902z+1. The denominator: z^2-1.807z+0.9025.

As a difference equation:

y[n]=1.807y[n-1]-0.9025y[n-2]+x[n]-1.902x[n-1]+x[n-2]

Five multiplies and four adds removes mains hum and leaves everything else nearly untouched. The closer r is to 1, the narrower the notch — and the closer to instability, so finite arithmetic precision sets a practical limit around 0.99.

That worked example is the single best demonstration of why the z-plane is worth learning: you drew the answer, and the coefficients fell out.

7. Inverting the transform

Long division gives the sequence term by term. Divide the numerator by the denominator in ascending powers of z^{-1} and read the coefficients. Good for a quick check of the first few samples, useless for a closed form.

Partial fractions, exactly as in Chapter 4.5, but with one wrinkle. Expand X(z)/z rather than X(z), then multiply back by z at the end. The reason is that the standard pairs all have a z in the numerator, so this arrangement makes the terms match the table.

Worked example.

X(z)=\frac{z}{(z-0.5)(z-0.8)}

\frac{X(z)}{z}=\frac{1}{(z-0.5)(z-0.8)}=\frac{A}{z-0.5}+\frac{B}{z-0.8}

A=\left.\frac{1}{z-0.8}\right|_{z=0.5}=\frac{1}{-0.3}=-3.33, \qquad B=\left.\frac{1}{z-0.5}\right|_{z=0.8}=\frac{1}{0.3}=3.33

Multiply back by z:

X(z)=\frac{-3.33z}{z-0.5}+\frac{3.33z}{z-0.8}

Read from the table:

x[n]=3.33\left[(0.8)^n-(0.5)^n\right]u[n]

Check n=0: 3.33(1-1)=0 ✓, consistent with the initial value theorem, since \lim_{z\to\infty}X(z) = \lim z/z^2 = 0.

Check n=1: 3.33(0.8-0.5)=1. And from long division, the coefficient of z^{-1} in z/(z^2-1.3z+0.4) is indeed 1 ✓.

8. Realising a filter as hardware

H(z) translates directly into a block diagram of delays, multipliers and adders, and there is more than one way to do it.

Direct Form I implements the difference equation literally: a chain of delays for the inputs feeding the b multipliers, another chain for the outputs feeding the a multipliers, everything summed. Needs M+N delay elements.

Direct Form II notes that the two delay chains are carrying related information and merges them, halving the memory to \max(M,N). Standard for software implementations, where memory is what you are counting.

The warning that matters in practice: Direct Form II can overflow internally even when the input and output are both within range, because the intermediate signal in the shared delay line can be larger than either. On a fixed-point processor this produces sudden loud noise from a filter that tested fine in floating point.

Cascade form breaks the filter into second-order sections (biquads) multiplied together:

H(z)=\prod_k \frac{b_{0k}+b_{1k}z^{-1}+b_{2k}z^{-2}}{1+a_{1k}z^{-1}+a_{2k}z^{-2}}

This is what everyone actually uses for anything above second order, and for a solid reason. A high-order polynomial's roots are extremely sensitive to its coefficients — round the coefficients of an eighth-order denominator to 16 bits and the poles can move enough to leave the unit circle, turning a designed filter into an oscillator. Splitting into biquads means each section has only two poles, whose positions depend on only two coefficients, and the sensitivity collapses.

Chapter 5.2 uses this throughout.


Chapter 4.7 closes Part 4 by proving the sampling theorem that this chapter's unit circle has been quietly assuming, and by showing exactly what goes wrong when it is violated.

Every formula above, built from scratch

None of the results in this chapter are worth memorising, because each one can be rebuilt in under a minute from something simpler. What follows is that rebuilding, one result at a time, so the formula and the reason for it sit on the same page as the explanation that needed them.

Z-transform

X(z)=\sum_{n=-\infty}^{\infty}x[n]z^{-n}, \qquad z=e^{sT_s}

Mapping consequences: |z|=e^{\sigma T_s} and \angle z=\omega T_s. The left half s-plane maps inside the unit circle; the imaginary axis maps onto the circle; the frequency axis wraps round once per f_s.

Stable if and only if every pole satisfies |p_i|\lt1.

Pairs

x[n]X(z)
\delta[n]1
\delta[n-k]z^{-k}
u[n]\dfrac{z}{z-1}
a^nu[n]\dfrac{z}{z-a}
n\,u[n]\dfrac{z}{(z-1)^2}
na^nu[n]\dfrac{az}{(z-a)^2}
\cos(\omega_0n)u[n]\dfrac{z(z-\cos\omega_0)}{z^2-2z\cos\omega_0+1}

Derivation of the exponential pair: \sum_{n\ge0}a^nz^{-n}=\sum(az^{-1})^n = \dfrac{1}{1-az^{-1}} by the geometric series, valid for |az^{-1}|\lt1.

Properties

x[n-k]\leftrightarrow z^{-k}X(z) \qquad\text{(a delay is a power of }z^{-1})

a^nx[n]\leftrightarrow X(z/a), \qquad x*h\leftrightarrow XH

x[0]=\lim_{z\to\infty}X(z), \qquad x[\infty]=\lim_{z\to1}(z-1)X(z)

Difference equation to transfer function

\sum_{k=0}^{N}a_ky[n-k]=\sum_{k=0}^{M}b_kx[n-k] \;\Longrightarrow\; H(z)=\frac{\sum b_kz^{-k}}{\sum a_kz^{-k}}

FIR: no a terms beyond a_0=1; always stable; impulse response is the b list.

IIR: feedback present; cheaper for a given sharpness; stability must be checked.

Inversion: expand X(z)/z in partial fractions, then multiply back by z, so the terms match the standard pairs.

What the next chapter fixes

Both discrete transforms assume samples already exist, and say nothing about how a continuous signal becomes them without damage. That gap matters more than it sounds: sample too slowly and frequencies do not merely disappear, they reappear disguised as other frequencies that were never there. Chapter 4.7 derives how often you must sample, and what goes wrong when you do not.