Here it is explained the process of designing a 1st order RC low pass IIR digital filter using the bilinear transformation method. The post begins with first order RC low pass filter circuit and the derivation of the Laplace transform equation for the filter. The Laplace transfer analog filter function H(s) is then converted to a Z-transform digital filter H(z) using the bilinear transformation method. The post covers the steps to calculate the filter coefficients using the given sampling frequency and cutoff frequency. Additionally, the post demonstrates how to implement the filter in MATLAB and provides a frequency response plot to show the filter's attenuation characteristics. This is useful to those who are interested in learning the basic of analog and digital filter system functions, designing simple filters for audio or signal processing applications. The step-by-step guide and MATLAB implementation will help beginners and professionals alike to understand and implement the bilinear transformation method for designing digital filters.

### RC Analog Low Pass Filter

The RC low pass filter circuit is shown below.

Applying KVL to the circuit we have,

\(v_{in}(t) = i(t)R + v_{out}(t)\) --->(1)

The current around the loop is,

\(i(t) = C \frac{dv_{out}(t)}{dt}\) --->(2)

Using (2) in (1),

\(v_{in}(t) = C \frac{dv_{out}(t)}{dt} R + v_{out}(t)\)

or, \(v_{in}(t) = RC \frac{dv_{out}(t)}{dt} + v_{out}(t)\)

Taking Laplace transform in the above equation,

\( \mathcal{L} \{ v_{in}(t) \} = RC \mathcal{L} \{ \frac{dv_{out}(t)}{dt} \} + \mathcal{L} \{ v_{out}(t) \} \)

or, \( V_{in}(s) = RC s V_{out}(s) + V_{out}(s) \)

or, \( V_{in}(s) = V_{out}(s) [s RC + 1] \)

or, \( \frac{V_{out}(s)}{V_{in}(s)} = \frac{1}{s RC + 1} \)

or, \(H(s) = \frac{1}{1+s RC} \) ---->(3)

This is the equation of the transfer function H(s) of RC low pass filter.

Poles and Zeros of the transfer function can be obtained by rearranging the above equation as follows.

\(H(s) = \frac{(1/RC)}{s+(1/RC)} \) ---->(4)

From (4) we see that as s goes to infinity, H(s) approaches Zero and hence the transfer function H(s) has a Zero at \(s=\infty\).

Similarly, from (4), when \(s=-1/RC\), the transfer function H(s) is infinity and hence we say that the transfer function has a pole at \(s=-1/RC\).

### RC Digital Low Pass Filter

The Z-Transform based transfer function can be obtained from the Laplace based transfer function using Bilinear Transformation. This effectively changes the filter transfer function from analog domain to digital domain.

To convert the Laplace transfer function H(s) to its corresponding Z-transform H(z) using the bilinear transformation method, we can use the substitution:

\(s = \frac{2(1-z^{-1}) }{T(1+ z^{-1})} \) -->(5)

where T is the sampling period of the digital system. Substituting this expression for s into the Laplace transfer function H(s) gives:

\( H(z) = H(s) |_{s = \frac{2(1-z^{-1}) }{T(1+ z^{-1})}} \)

\( H(z) = \frac{(1/RC)}{ \frac{2(1-z^{-1}) }{T(1+ z^{-1})} + (1/RC)} \)

let \(w_c = \frac{1}{RC}\)

so, \( H(z) = \frac{w_c}{ \frac{2(1-z^{-1}) }{T(1+ z^{-1})} + w_c} \)

or, \( H(z) = \frac{w_cT + w_c T z^{-1}}{ w_c T + w_c T z^{-1} +2 - 2 z^{-1}} \)

So the Z-transform of the given Laplace transfer function using the bilinear transformation method is:

\( H(z) = \frac{w_cT + w_c T z^{-1}}{ (w_c T + 2) + (w_c T - 2) z^{-1}} \) --->(6)

Let the cutoff frequency be \(f_c = 1kHz\) and the sampling frequency is \(f_s = 44.1kHz\).

We have,

\(f_c = \frac{1}{2 \pi RC}\)

Then if C=0.1uF then R=1.59kOhm and so,

\(w_c = 2 \pi (1kHz) = 6,280\)

And, \(T = \frac{1}{f_s} = \frac{1}{44.1kHz} = 22.67 \mu s \)

Therefore, \(w_c T = 6,280 \times 22.67 \mu s = 0.142 \)

Using this in equation(6),

\( H(z) = \frac{0.142+ 0.142 z^{-1}}{ (0.142+2) + (0.142-2)z^{-1}} \)

that is, \( H(z) = \frac{0.142+ 0.142 z^{-1}}{ 2.142 - 1.858 z^{-1}} \) ---->(7)

The general Z-Tranform equation is,

\( H(z) = \frac{b_0 + b_1 z^{-1}}{ a_0 +a_1 z^{-1}} \) ---->(8)

Comparing the Z-Transform equation(7) with the general Z-Transform equation, the coefficients of the low pass filter are:

\( b_0 = 0.142, b_1 = 0.142, a_0 = 2.142, a_1 = -1.858 \)

The following Matlab program plots the frequency response of H(z) of the RC first order filter.

```
% Given parameters
fs = 44100; % sampling frequency
fc = 1000; % analog frequency cutoff
wc = 2*pi*fc;
% Bilinear transformation coefficients
T = 1/fs;
b0 = wc*T;
b1 = wc*T;
a0 = wc*T + 2;
a1 = wc*T - 2;
b = [b0 b1];
a = [a0 a1];
% Plot frequency response of H(z)
freqz(b, a);
```

**Conclusion**

So here it was described the process of designing a 1st order RC low pass filter with a cutoff frequency of 1kHz using the bilinear transformation method. It covers the derivation of the Laplace transform equation, conversion to a digital filter, and implementation in MATLAB with the frequency response plot. Also the filter coefficient calculation from analog filter was derived. But in Matlab the digital filter coefficients can be calculated easily, see how to calculate IIR filter coefficients in Matlab.

** References**:

[1] FIR and IIR filter design with Z-transform

[2] FIR filter design by frequency sampling