The bilinear transform is a method for designing digital filters from analog models. More precisely, it brings filters from the Laplace domain to the z-domain:
$$ H(s) \xrightarrow[\text{Transform}]{\text{Bilinear}} H(z) $$
In contrast to the impulse invariance method (that operates in the time domain), the bilinear transform is performed in the frequency domain. To do this, the continuous-time s-plane is morphed to the disrete-time z-plane by bending the frequency axis to become the unit circle:
To get the bilinear transform for a given $H(s)$, we need to substitute $s$ with:
$$ \boxed{ s = \frac{2}{T} \frac{1-z^{-1}}{1+z^{-1}} } $$
with the sampling period $T$:
$$ T=\frac{1}{f_s} $$
Passive RC Lowpass Example¶
A simple example for the bilinear transform can be shown for the first order RC lowpass:
Transfer Function¶
The resulting filter has a low pass characteristic with the following frequency response:
In the Laplace domain its transfer function is defined as (see Laplace Section):
$$ H(s) = \frac{\omega_c}{\omega_c + s} = \frac{1}{1 + \frac{s}{\omega_c}} $$
$s$ represents the Laplace operator:
$$ s = \sigma + j \omega $$
The cutoff frequency $\omega_c$ of the passive filter is:
$$ \omega_c = \frac{1}{RC} $$
Substitution¶
For a transform to the z-domain, the Laplace operator $s$ is subsstituted by the $z$ operator:
$$ s = \frac{2}{T}\frac{1-z^{-1}}{1+z^{-1}} $$
The following steps rearrange the resulting transfer function to be comprised of two polynomials with $z^{-n}$:
$$ \begin{align} % % H(z) = & \frac{\omega_c}{\omega_c + \frac{2}{T} \frac{1-z^{-1}}{1+z^{-1}}} \\ % = & \frac{\frac{T}{2} \omega_c}{ \frac{T}{2} \omega_c + \frac{1-z^{-1}}{1+z^{-1}}} \\ % = & \frac{\frac{T}{2} \omega_c (1+ z^{-1})}{ \frac{T}{2} \omega_c (1+ z^{-1}) + 1-z^{-1}} \\ % = & \frac{\frac{T}{2} \omega_c + \frac{T}{2} \omega_c z^{-1}}{ \frac{T}{2} \omega_c (1+ z^{-1}) + 1-z^{-1}} \\ % = & \frac{\frac{T}{2} \omega_c + \frac{T}{2} \omega_c z^{-1}}{ \frac{T}{2} \omega_c + \frac{T}{2} \omega_c z^{-1} + 1-z^{-1}} \\ % = & \frac{\frac{T}{2} \omega_c + \frac{T}{2} \omega_c z^{-1}}{1 + \frac{T}{2} \omega_c + (\frac{T}{2} \omega_c -1 )z^{-1}} \\ % \end{align} $$
For getting the coefficients of our digital filter, the transfer function needs to meet the following structure with $a_0=1$:
$$ H(z) = \frac{b_0 + b_1 z^{-1}}{1+ a_1 z^{-1}} $$
This is achieved by expanding and simplifying:
$$ \begin{align} % % H(z) = & \frac{\frac{T}{2} \omega_c + \frac{T}{2} \omega_c z^{-1}}{ \underbrace{ \mathbf{\color{gray} 1 + \frac{T}{2} \omega_c }}_{\text{must be 1}} + \left(\frac{T}{2} \omega_c -1 \right)z^{-1}} \\ % = & \frac{\frac{\frac{T}{2} \omega_c}{ 1 + \frac{T}{2} \omega_c} + \frac{ \frac{T}{2} \omega_c}{ 1 + \frac{T}{2} \omega_c} z^{-1}}{1+ \left(\frac{\frac{T}{2} \omega_c}{1 + \frac{T}{2} \omega_c} - \frac{1}{1 + \frac{T}{2} \omega_c} \right)z^{-1}} \\ % = & \frac{\frac{\frac{T}{2} \omega_c}{ 1 + \frac{T}{2} \omega_c} + \frac{ \frac{T}{2} \omega_c}{ 1 + \frac{T}{2} \omega_c} z^{-1}}{1+ \left(\frac{\frac{T}{2} \omega_c -1}{ \frac{T}{2} \omega_c + 1} \right)z^{-1}} \\ \end{align} $$
Coefficients¶
Following the above rearrangements, the coefficients can be directly extracted from the transfer funcion:
$$ H(z) = \frac{\frac{\frac{T}{2} \omega_c}{ 1 + \frac{T}{2} \omega_c} + \frac{ \frac{T}{2} \omega_c}{ 1 + \frac{T}{2} \omega_c} z^{-1}}{1+ \left(\frac{\frac{T}{2} \omega_c -1}{ \frac{T}{2} \omega_c + 1} \right)z^{-1}} = \frac{b_0 + b_1 z^{-1}}{1+ a_1 z^{-1}} $$
$$ \begin{align} \mathbf b_0 = & \frac{\frac{T}{2} \omega_c}{ 1 + \frac{T}{2} \omega_c} \\ \mathbf b_1 = & \frac{\frac{T}{2} \omega_c}{ 1 + \frac{T}{2} \omega_c} \\ \mathbf a_1 = & \frac{\frac{T}{2} \omega_c -1}{ \frac{T}{2} \omega_c + 1} \\ \end{align} $$
Filter Topology¶
The original dependence of the electrical components R and C is not important at this point. However, with $\omega_c$ = $2 \pi f_0$ we can get the exact coefficients for any cutoff frequency which can be used for the difference equation or applied in the following topology:
Frequency Distortion¶
With the continuous frequency $\omega_C$ and the discrete frequency $\omega_D$, analog and digital frequencies have the following relation:
$$ \omega_C = \frac{2}{T} \tan \left( \frac{\omega_D T}{2} \right) $$
For small values, this can be considered linear. The larger the values, the more distortion.
Pre-Warping¶
The following pre-warping is required, considering the cutoff frequency of the analog filter $\hat{\omega}_c$ and the cutoff frequency $\omega_0$ of the digital filter:
$$\begin{eqnarray} jω_a &=& \frac{2}{T} \frac{1−e^{−jω_dT}}{1+e^{−jω_dT}} \\ &=& \frac{2}{T} \frac{1−e^{−jω_dT}}{1+e^{−jω_dT}} \\ &=& \frac{2}{T} \frac{e^{-jωd T/2}(e^{jωd T/2} − e^{−jωd T/2})}{e^{−jωd T/2}(e^{2jωd T/2} + e^{−jωd T/2})}\\ &=& \frac{2}{T} \cos\left( ω_d\frac{T}{2} \right) j \sin\left( ω_d\frac{T}{2} \right)\\ &=& j \frac{2}{T} \tan \left( ω_d\frac{T}{2} \right) \end{eqnarray}$$
With pre-warping, any frequency - for example $\omega_c$ from the RC low-pass example - can be corrected with the following equation:
$$ \hat{\omega}_c = \frac{2}{T} \tan \left( \frac{\omega_c T}{2} \right) $$
The bilinear transform results in:
$$ s = \frac{\omega_c}{\tan \left( \frac{\omega_c T}{2} \right)} \frac{1-z^{-1}}{1+z^{-1}} $$
Create an IIR filter of this circuit with the bilinear transform.
Find expressions for $a_n$ and $b_n$.