Z Transform
The Z-transform is the time-discrete equivalent of the Laplace transform. For a time series $x[n]$, the unilateral Z-transform is defined by the following equation:
$$ X[z] = \sum_{n=0}^{\infty} x[n] z^{-n} $$
$z$ is a complex number:
$$z = \ e^{j\varphi}$$
This can also be expressed as:
$$z = \cos \varphi + j \sin \varphi $$
Z-Transform for Digital Filters¶
The Z-transform can be used to investigate the stability of discrete LTI systems, such as FIR and IIR filters. This is achieved by applying the transform to the filter coefficients.
Transfer Function¶
In general, the transfer function of a system describes the relation between input and output. Considering the Z-Transform, this means:
$$ H(z) = \frac{Y(z)}{X(z)} = \frac{\mathcal Z\{y[n]\}}{\mathcal Z\{x[n]\}} $$
Difference Equation¶
We know the difference equation of a digital filter can be expressed with two sums - one for forward and one for recirsive coefficients:
$$ y[n] = \sum\limits_{i=0}^{i=N} b_i x[n-i] - \sum\limits_{i=1}^{i=N} a_i y[n-i] $$
Transform¶
The transfer function of the filter can be obtained via the z-transform:
$$\begin{eqnarray} Y(z) & = & X(z) \sum\limits_{i=0}^{i=N} b_i z^{-i} - Y(z) \sum\limits_{i=1}^{i=N} a_i z^{-i} \\ & = & X(z) \sum\limits_{i=0}^{i=N} b_i z^{-i} + Y(z) \sum\limits_{i=1}^{i=N} -a_i z^{-i} \end{eqnarray} $$
This equation can be rearranged to result in the following fraction of two polynoms:
$$ H(z) = \frac{\sum\limits_{n=0}^{n=N} b_n z^{-n}}{1 -\sum\limits_{n=1}^{n=N} a_n z^{-n}} $$
FIR Example¶
This example shows how the z-transform can be used to analyse a digital filter. We are considering an FIR filter with the following difference equation:
$$ y[n] = 0.5 x[n-2] + x[n-2] + 0.5 x[n-4] $$
The z-transform of this filter is:
$$ H(z) = \frac{0.5 z^{-2} + z^{-3} + 0.5 z^{-4}}{1} $$
There is no feedback - hence no $a_i$.
In the next step, all exponents are shifted by expanding with $z^{4}$ to have only positive exponents:
$$ H(z) = \frac{z^2 + 2z + 1}{z^4} $$
We now have a fraction with two polynoms. To analyse the filter, we are observing:
- Poles: when the denominator becomes $0$
- Zeros: when the nominator becomes $0$
Factor the denominator to find its roots:
$$ H(z) = \frac{(z+1)(z+1)}{z^4} $$
There is a double zero at $\mathbf{z=-1}$. As all causal FIR filters it has $N=4$ poles at the origin $z=0$.
With $z=e^{j\omega}$ the complex roots can be obtained:
$$ Z = (e^{-i\omega} +1)(e^{-i\omega} +1) $$
In the Z-Plane¶
The Z-Plane is the time-discrete counterpart to the S-Plane for the Laplace transform. It shows the complex variable $z$ with its real and imaginary component.
The poles and zeros for the above filter are plotted below. This can be interpreted as follows: The magnitude of the transfer function will be large for values of $z$ closer to the poles and smaller for $z$ in near the zeros.