Screencast video [⯈]
In contrast to FIR filters, IIR filters have besides zeros also poles and for this reason we have to take care about stability, since a stable filter requires all poles to be within the unit circle. For FIR filters we have seen that filters with symmetric impulse responses lead to linear phase filters. However, for IIR filters it is not possible to realise linear phase filters or filters with a predefine phase characteristic. There are powerful highly advanced design procedures that facilitate the design of analog filters. For this reason a common design approach for IIR digital filters is to first design an analog IIR filter and then map it into an equivalent digital filter. Here we will discuss the following 3 approaches:
- The impulse invariance approach, in which a digital filter is designed by sampling the impulse response of an analog filter.
- Mapping differential equation, which describes the input- output relation of an analog filter, into a difference equation, which describes the input- output relation of a digital filter.
- The bilinear transform, which maps the description of the analog filter in the complex $s$-plane into a description of the digital filter in the complex $z$-plane.
Impulse invariant approach
The impulse invariant approach consists of the following steps:
- Start with the impulse response $h_a(t)$ of an analog filter, or eventually with the frequency response $H_a(\omega)$, which is related to the impulse response via the Fourier Transform for Continuous time signals (FTC) and systems.
- Then the discrete time impulse response $h_d[n]$ is created by sampling $h_a(t)$, with an inter sample distance of $T$ seconds. $$ h_a(t)|_{t=n \cdot T} = h_d[n] \overset{\mbox{FTD}}{\circ \hspace{-1.7mm} - \hspace{-1.7mm} \circ} H_d(e^{j\theta}) =\color{brown}{ \frac{1}{T} \sum_{k=- \infty}^{\infty} H_a(\omega - k \cdot \frac{2 \pi}{T})|_{\omega=\frac{\theta}{T}}} $$ The discrete time frequency response $H_d(e^{j\theta})$ follows from the FTD. From the module sampling and reconstruction we have seen that as a result of the sampling process the discrete time frequency response can be constructed as an infinite sum of shifted and overlapped continuous time frequency responses $H_a(\omega)$, in which the shifts are inversely proportional to $1/T$. The spectral overlap causes aliasing which is the price paid by using this design approach.
When sampling with a 4 times finer inter-sample distance of $T=1/4$ [sec] the results are shown in Fig. 3.
Mapping differential- to difference-equations
The input output relation of a continuous time system can be described by a differential equation, as shown in the following equation: $$ y_a(t) = \sum_{i=0}^{N} b_i \frac{d^i x_a(t)}{d t^i} + \sum_{i=0}^{M} a_i \frac{d^i y_a(t)}{d t^i} \hspace{2mm} \overset{\mbox{LT}}{\circ \hspace{-1.7mm} - \hspace{-1.7mm} \circ} \hspace{2mm} H_a(s)=\frac{\sum_{i=0}^{N} b_i s}{1 - \sum_{i=1}^{M} a_i s} $$ This differential equation is related to the continuous time system function $H_a(s)$ via the Laplace Transform, abbreviated as LT.
Approximate differential by backward difference
The first option of this second design approach is to approximate each continuous time differential by the following backward difference equation in the discrete time domain: $$ \color{red}{\frac{d y_a(t)}{d t} \approx } \frac{y_a(nT) - y_a(nT-T)}{T} = \color{red}{\frac{y_d[n] - y_d[n-1]}{T} } $$ By doing so the system functions in continuous time $H_a(s)$ and discrete time $H_d(z)$ can be related to each other by using the following steps:
First the Laplace Transform of a differential equation is simply a multiplication with the complex variable $s$ in the $S$ domain: \begin{eqnarray*} \frac{d y_a(t)}{d t} & \overset{\mbox{LT}}{\circ \hspace{-1.7mm} - \hspace{-1.7mm} \circ} & {\color{brown} s} \cdot Y_a(s) \end{eqnarray*} Secondly the backward difference equation transforms via the $Z$ transform to following equation: \begin{eqnarray*} \frac{y_d[n] - y_d[n-1]}{T} & \overset{\mbox{ZT}}{\circ \hspace{-1.7mm} - \hspace{-1.7mm} \circ} & \frac{Y_d(z) - z^{-1} Y_d(z)}{T} = \left ( \color{brown}{\frac{1 - z^{-1}}{T}} \right ) \cdot Y_d(z) \end{eqnarray*} By comparing these two equations it follows that the complex variable $s$ is replaced by the complex variable $1-z^{-1}/T$ when approximating the differential by a backward difference or the other way around replace $z$ by $1/(1-sT)$: \begin{eqnarray*} s=\frac{1 - z^{-1}}{T} & \leftrightarrow & \color{red}{z = \frac{1}{1-s \cdot T}} \end{eqnarray*}
Approximate differential by forward difference
As an alternative we can approximate the differential by a forward difference equation: $$ \color{red}{\frac{d y_a(t)}{d t} \approx } \frac{y_a(nT+T) - y_a(nT)}{T} = \color{red}{\frac{y_d[n+1] - y_d[n]}{T} } $$ This leads to the result that in this case the complex variable $s$ is replaced by the complex variable $(z-1)/T$, or the other way around $z$ is replaced by $1+sT$: \begin{eqnarray*} s=\frac{z-1}{T} & \leftrightarrow & \color{blue}{z = 1+s \cdot T} \end{eqnarray*}
Mapping of poles and zeros with backward and forward approximation
For stable systems it is important that stable poles of the analog system, which are at the left hand side in the complex $S$ plane, are mapped inside the unit circle in the $Z$ plane. This is automatically the case where the differential is approximated by the backward difference equation.
Example
Apply backward and forward difference with $T=1/2$ on the system with system function: $H_a(s) = (2 s+22)/((s+1)(s^2 + 4s + 13))$. Are both approaches stable?
Using the backward difference approach, with sampling rate $T=1/2$, leads to the following expression: \begin{eqnarray*} s_{ba}=2 -2z^{-1}& \Rightarrow & H_{d,ba}(z)= \frac{ 26 - 4 z^{-1}}{(3 -2 z^{-1}) \cdot (4 - 3 j - 2 z^{-1}) \cdot (4 + 3 j - 2 z^{-1}) } \end{eqnarray*} From this it follows that all poles are inside the unit circle and thus the discrete time system is stable. However when using the forward difference approach the result is as follows: \begin{eqnarray*} s_{fo}=2z-2& \Rightarrow & H_{d,fo}(z)=\frac{4z+18}{(2z-1)(2z+3j)(2z-3j)} \end{eqnarray*} From this it follows that there are two poles which are located outside the unit circle and thus the system is not guaranteed to be stable. So we can not use this approach for this example.
Bilinear transform
The third design approach uses the bilinear transform, which is a rational function that maps the left-half $S$ plane inside the unit circle and maps the imaginary axis of the $S$ plane in a one-to-one manner onto the unit circle in the $Z$ plane.
The relation between the mapping of the imaginary axis in the $S$ plane onto the unit circle is highly non linear which can be shown as follows:
With $s= j \omega$ and $z=e^{j\theta}$ the transformation with $s= \frac{2}{T} \cdot \frac{1 - z^{-1}}{1+z^{-1}}$ becomes as follows: $$ j \cdot \left ( \omega \right )= \frac{2}{T} \cdot \frac{1-e^{-j\theta}}{1+ e^{-j\theta}}= j \cdot \left ( \frac{2}{T} \frac{\sin (\theta/2)}{\cos (\theta/2)} \right ) = j \cdot \left ( \frac{2}{T} \tan (\theta/2) \right ) $$ From this result we can derive the so called frequency warping function: $$ \theta = 2 \arctan (\omega T/2) $$ The result of this non linear mapping is shown in Fig. 6.