Bode plot of the discrete low-pass filter (interactive).

**The Basics**

It has occurred to me that most engineers and scientists are quite familiar with the basic formula of an infinite-impulse response (IIR) low-pass filter (LPF):

This low-pass filter variation is easy to implement on processors or FPGAs.

Also, such filter should in some way correspond to the following first-order continuous-time transfer function:

In this short tutorial, we will derive the relationship between the corner frequency "omega" in the continuous time domain and the "a" coefficient in the sampled time domain.

**First-order IIR Low-pass Filter Design & Discretization**

- Determine the corner frequency of your low-pass filter. The corner frequency should be at most 10% of the system sample rate.
- Discretize- use the "zero-order hold" approach. The reason to use this approach is to emulate the sample & hold behavior:

A continuous-time domain filter with input and output signals is shown below:

Continuous-time domain signals and a digital filter are represented as:

The formula to discretize a transfer function preceded by a zero-order hold follows:

From Laplace to Z-domain lookup table:

Therefore:

A bit more rearranging leads to:

The next step is to do an inverse Z-transform:

And shift by one sample:

**MatLab script**

A basic MatLab script (below) verifies the equivalency between the continuous transfer function and its discrete time-domain counterpart.

Note that the sampling rate was chosen as 500 Hz and the break frequency as 50 rad/s or ~8 Hz.

```
```

% First-order Low-Pass Filter Discretization

%

% Control Systems Academy team

%

% 6/25/2017

clc; format compact

% Continuous time filter

s = tf('s');

w = 50; % rad/s

H = w/(s+w)

T = 1/500;

Hd = c2d(H,T,'zoh')

opts = bodeoptions;

opts.FreqUnits = 'rad/s';

opts.XLim = [0.01, 10000];

opts.Grid = 'on';

bode(H,Hd, opts)

% no more

Magnitude and Phase Bode plots of a continuous low-pass filter with corner frequency 50 rad/s. The discrete counterpart has 200 Hz sampling frequency.

Q: Can IIR (infinite-impulse response) filters become unstable?

A: Yes. These filters have a negative-feedback path and a single incorrect parameter computation can result in oscillations or output out-of-bound instability.

The benefit of IIR filters is their ease of use with constant coefficients and a simple transfer function representation.

FIR filters are generally used in more advanced digital signal processing (DSP), such as in transceivers.

Further Reading

In MatLab, DSPs, and FPGAs.

.

The fundamentals of signal flow.

Introduction to dynamic systems.

It is all sine waves.

Please leave us a comment regarding the content at this page.