Unit 6 - Notes

ECE220 12 min read

Unit 6: The Z- transform

Introduction

The Z-transform is the discrete-time counterpart to the Laplace transform. It is a powerful mathematical tool used for the analysis of discrete-time signals and Linear Time-Invariant (LTI) systems.

Why the Z-transform?

  1. Generalization of the DTFT: The Discrete-Time Fourier Transform (DTFT) of a sequence x[n] exists only if the sequence is absolutely summable. The Z-transform converges for a much broader class of signals, including those that are not stable or do not have a DTFT (e.g., x[n] = a^n u[n] for |a| > 1). The DTFT can be seen as the Z-transform evaluated on the unit circle (z = e^{jω}).
  2. LTI System Analysis: It converts linear constant-coefficient difference equations into algebraic equations, simplifying the analysis of LTI systems.
  3. System Properties: It provides a concise method to determine crucial system properties like causality and stability by examining the system's transfer function and its Region of Convergence (ROC).
  4. Frequency Response: The frequency response of a system can be easily obtained from its Z-transform representation.

Relationship to other transforms:

  • Laplace Transform (Continuous-Time): Analogous. The role of the s-plane in continuous time is played by the z-plane in discrete time.
  • DTFT (Discrete-Time): A special case. DTFT{x[n]} = X(z)|_{z=e^{jω}}.

The Z-transform

Definition

The Z-transform converts a discrete-time signal x[n], which is a sequence of numbers, into a complex function X(z) of a complex variable z.

There are two forms of the Z-transform:

  1. Bilateral (Two-Sided) Z-transform:
    This is the general definition and is applied to non-causal signals that are non-zero for both n < 0 and n ≥ 0.

  2. Unilateral (One-Sided) Z-transform:
    This is used for causal signals where x[n] = 0 for n < 0. It is particularly useful for solving difference equations with initial conditions.

Unless specified otherwise, "Z-transform" usually refers to the bilateral transform.

Example: Z-transform of a Causal Exponential

Let x[n] = a^n u[n], where u[n] is the unit step function.

This is a geometric series. It converges if |az^{-1}| < 1, which simplifies to |z| > |a|. If it converges, the sum is:

So, the Z-transform pair is:
a^n u[n] \quad \Leftrightarrow \quad \frac{1}{1 - az^{-1}}, for |z| > |a|.


The Region of Convergence (ROC) for the Z-transform

The Region of Convergence (ROC) is the set of all values of z in the complex z-plane for which the Z-transform summation converges.

The ROC is crucial: A Z-transform expression X(z) is not unique without its corresponding ROC. Different signals can have the same X(z) expression but different ROCs.

Properties of the ROC

  1. Shape: The ROC is a ring or a disk in the z-plane, centered at the origin. It cannot contain any poles.
  2. Finite-Duration Sequences:
    • If x[n] is a finite-duration sequence (non-zero only for N_1 ≤ n ≤ N_2), the ROC is the entire z-plane, except possibly z = 0 (if the sequence has non-zero values for n > 0) or z = ∞ (if the sequence has non-zero values for n < 0).
  3. Right-Sided Sequences:
    • A sequence is right-sided if x[n] = 0 for n < N_1.
    • The ROC is the exterior of a circle: |z| > r_max, where r_max is the magnitude of the outermost pole.
    • If the sequence is causal (x[n] = 0 for n < 0), the ROC includes z = ∞.
  4. Left-Sided Sequences:
    • A sequence is left-sided if x[n] = 0 for n > N_2.
    • The ROC is the interior of a circle: |z| < r_min, where r_min is the magnitude of the innermost non-zero pole.
    • If the sequence is anti-causal (x[n] = 0 for n > 0), the ROC includes z = 0.
  5. Two-Sided Sequences:
    • A sequence that is neither right-sided nor left-sided.
    • The ROC is an annular region (a ring) between two poles: r_1 < |z| < r_2. The ROC, if it exists, is the intersection of the ROC of its causal part and its anti-causal part.

Example: ROC determining the signal

Consider the Z-transform X(z) = \frac{1}{1 - 0.5z^{-1}}.

  • Case 1: ROC is |z| > 0.5
    This is the exterior of a circle passing through the pole at z=0.5. This corresponds to a right-sided (causal) sequence:
    x[n] = (0.5)^n u[n]

  • Case 2: ROC is |z| < 0.5
    This is the interior of a circle. This corresponds to a left-sided (anti-causal) sequence:
    x[n] = -(0.5)^n u[-n-1]

This demonstrates that both the expression and the ROC are required to uniquely define the signal.


Properties of the Z-transform

Let x[n] \leftrightarrow X(z) with ROC R_x and y[n] \leftrightarrow Y(z) with ROC R_y.

Property Time Domain Z-Domain New ROC
Linearity a x[n] + b y[n] a X(z) + b Y(z) At least R_x \cap R_y
Time Shifting x[n-n_0] z^{-n_0} X(z) R_x (except possibly adding/removing z=0 or z=∞)
Scaling in z-domain a^n x[n] X(z/a) |a| R_x (ROC is scaled by |a|)
Time Reversal x[-n] X(1/z) 1/R_x (ROC is inverted)
Differentiation in z n x[n] -z \frac{dX(z)}{dz} R_x
Convolution x[n] * y[n] X(z) Y(z) At least R_x \cap R_y
Initial Value Theorem x[0] (for causal x[n]) \lim_{z \to \infty} X(z)
Final Value Theorem \lim_{n \to \infty} x[n] \lim_{z \to 1} (z-1)X(z) Requires poles of (z-1)X(z) to be inside unit circle.

The Inverse Z-transform

The process of finding the time-domain signal x[n] from its Z-transform X(z) is called the inverse Z-transform.

Common methods for finding the inverse Z-transform for rational functions X(z) = N(z)/D(z):

1. Partial Fraction Expansion (PFE)

This is the most common and systematic method.

Step 1: Ensure X(z) is a proper rational function (degree of numerator ≤ degree of denominator). If not, perform long division first. It is often easier to perform PFE on X(z)/z and then multiply the result by z.

Step 2: Find the poles of X(z) by finding the roots of the denominator D(z).

Step 3: Expand X(z) (or X(z)/z) into a sum of simpler terms.

  • Case A: Distinct Poles
    If X(z) = \frac{N(z)}{(z-p_1)(z-p_2)...(z-p_M)}, then

    where the residue A_k is found by: A_k = [(z-p_k)X(z)]_{z=p_k}

  • Case B: Repeated Poles
    If a pole p_1 is repeated r times, the expansion will include terms:

    The coefficients are found using derivatives. For example: C_k = \frac{1}{(r-k)!} \frac{d^{r-k}}{dz^{r-k}} [(z-p_1)^r X(z)]_{z=p_1}

Step 4: Find the inverse transform of each term using a standard Z-transform table, considering the ROC to decide if the term corresponds to a causal or anti-causal sequence.

2. Power Series Expansion (Long Division)

This method involves expanding X(z) into a power series in terms of z^{-1} (for causal signals) or z (for anti-causal signals). The coefficients of the series are the values of the signal x[n].

  • For a causal signal (ROC: |z| > r): Divide the numerator by the denominator, arranging both in descending powers of z (or ascending powers of z^{-1}). The result is a series X(z) = c_0 + c_1z^{-1} + c_2z^{-2} + ..., where x[n] = c_n.

  • For an anti-causal signal (ROC: |z| < r): Divide the numerator by the denominator, arranging both in ascending powers of z. The result is a series X(z) = ... + d_{-2}z^2 + d_{-1}z^1, which corresponds to x[n] for n < 0.

This method is useful for finding the first few terms of a sequence but doesn't provide a closed-form solution.

3. Contour Integration (Residue Method)

This is the formal definition of the inverse Z-transform. It is powerful but less commonly used in introductory courses for direct computation.


where C is a counter-clockwise contour in the ROC of X(z) encircling the origin. The integral is evaluated using Cauchy's Residue Theorem.


Analysis and Characterisation of LTI Systems using Z-transforms

For an LTI system, the Z-transform provides a powerful framework for analysis.

The Transfer Function, H(z)

The transfer function (or system function) H(z) of an LTI system is the Z-transform of its impulse response h[n].

From the convolution property, the input X(z) and output Y(z) are related by:

For a system described by a linear constant-coefficient difference equation:
\sum_{k=0}^{N} a_k y[n-k] = \sum_{k=0}^{M} b_k x[n-k]

Taking the Z-transform of both sides (assuming zero initial conditions) and using the time-shifting property gives:
Y(z) \sum_{k=0}^{N} a_k z^{-k} = X(z) \sum_{k=0}^{M} b_k z^{-k}

Thus, the transfer function is a rational function of z^{-1} (or z):

  • Zeros: The roots of the numerator polynomial are the zeros of the system. At these values of z, H(z) = 0.
  • Poles: The roots of the denominator polynomial are the poles of the system. At these values of z, H(z) = ∞.

Causality and Stability

The properties of an LTI system can be determined from its transfer function H(z) and its ROC.

1. Causality:

  • An LTI system is causal if its impulse response h[n] is zero for n < 0.
  • Condition in Z-domain: An LTI system is causal if and only if the ROC of its transfer function H(z) is the exterior of a circle and includes z = ∞.
  • For a rational H(z), this means the degree of the numerator cannot be greater than the degree of the denominator.

2. Stability (BIBO Stability):

  • An LTI system is Bounded-Input, Bounded-Output (BIBO) stable if every bounded input produces a bounded output.
  • This is equivalent to the impulse response h[n] being absolutely summable: \sum_{n=-\infty}^{\infty} |h[n]| < \infty.
  • Condition in Z-domain: An LTI system is BIBO stable if and only if the ROC of its transfer function H(z) includes the unit circle (|z|=1).

Combining Causality and Stability for LTI Systems:

  • A causal LTI system with a rational transfer function H(z) is stable if and only if all its poles lie inside the unit circle.
  • Why? If the system is causal, its ROC is |z| > r_max (where r_max is the magnitude of the outermost pole). For this ROC to include the unit circle (|z|=1), we must have r_max < 1. This implies all poles must have a magnitude less than 1.

Software Simulation of System Representation and Pole-Zero Analysis

We can use software like Python with the scipy and matplotlib libraries to analyze LTI systems.

Example System

Consider a system described by the difference equation:
y[n] - 1.5y[n-1] + 0.9y[n-2] = x[n] + 0.5x[n-1]

1. Find the Transfer Function H(z):
Taking the Z-transform:
Y(z)(1 - 1.5z^{-1} + 0.9z^{-2}) = X(z)(1 + 0.5z^{-1})

The system is defined by its numerator b and denominator a coefficients.

  • b = [1, 0.5, 0]
  • a = [1, -1.5, 0.9]

Python Implementation

PYTHON
import numpy as np
import matplotlib.pyplot as plt
from scipy import signal

# 1. Define the system using numerator (b) and denominator (a) coefficients
# H(z) = (b[0] + b[1]z^-1 + ...) / (a[0] + a[1]z^-1 + ...)
b = [1, 0.5]
a = [1, -1.5, 0.9]

# Create a transfer function object
system = signal.TransferFunction(b, a, dt=1) # dt=1 for discrete-time system

# 2. Find Zeros, Poles, and Gain
z, p, k = signal.tf2zpk(b, a)
print(f"Zeros: {z}")
print(f"Poles: {p}")
print(f"Gain (k): {k}")

# 3. Plot the Pole-Zero Diagram
plt.figure(figsize=(8, 8))
ax = plt.subplot(111)

# Plot the unit circle
unit_circle = plt.Circle((0,0), 1, color='gray', fill=False, linestyle='--')
ax.add_patch(unit_circle)

# Plot poles ('x') and zeros ('o')
plt.scatter(p.real, p.imag, s=100, marker='x', color='r', label='Poles')
plt.scatter(z.real, z.imag, s=100, marker='o', facecolors='none', edgecolors='b', label='Zeros')

plt.title('Pole-Zero Plot')
plt.xlabel('Real Part')
plt.ylabel('Imaginary Part')
plt.grid(True, which='both')
plt.axis('equal')
plt.xlim([-2, 2])
plt.ylim([-2, 2])
plt.legend()
plt.show()

# Analysis from pole-zero plot:
# All poles are inside the unit circle. Since the system is causal by definition
# (from the difference equation), the system is STABLE.

# 4. Plot the Frequency Response (Magnitude and Phase)
# The frequency response is H(z) evaluated on the unit circle (z = e^jω)
w, h = signal.freqz(b, a)

fig, (ax1, ax2) = plt.subplots(2, 1, figsize=(8, 6))

# Magnitude Response
ax1.plot(w / np.pi, 20 * np.log10(abs(h)))
ax1.set_title('Frequency Response')
ax1.set_ylabel('Magnitude [dB]')
ax1.grid(True)

# Phase Response
ax2.plot(w / np.pi, np.angle(h) * 180 / np.pi)
ax2.set_xlabel('Normalized Frequency (x $\pi$ rad/sample)')
ax2.set_ylabel('Phase [degrees]')
ax2.grid(True)
plt.show()


# 5. Plot the Impulse Response
# Find the impulse response h[n] by taking the inverse Z-transform of H(z)
n_samples = 50
t, h_n = signal.dimpulse((b, a, 1), n=n_samples)

plt.figure(figsize=(8, 4))
plt.stem(t, np.squeeze(h_n))
plt.title('Impulse Response h[n]')
plt.xlabel('n (samples)')
plt.ylabel('Amplitude')
plt.grid(True)
plt.show()

# Analysis from impulse response:
# The impulse response decays to zero, which is another indication of a stable system.

This simulation workflow allows engineers and students to:

  • Visually confirm stability by checking if poles are inside the unit circle.
  • Understand how pole and zero locations shape the frequency response (e.g., poles near the unit circle create peaks in magnitude).
  • Observe the time-domain behavior (impulse response) resulting from the system's pole-zero configuration.