Spring, 1997

Digital Filter Design and Implementation

We have studied several methods for designing FIR filters, and we have learned how to design FIR and IIR filters with Matlab. The objective in this lab is to

Please design lowpass FIR and IIR digital filters to meet the specifications on Homework 8, which in terms of a normalized sampling rate of 1 Hz are:

Sampling rate: 1 Hz (you choose a suitable value for implementation)Choose a design method that produces digital filters with "minimum complexity". In other words, try to design filters that require the least amount of computation per sample in the real-time implementation.

Passband: 0 to 0.2 Hz

Stopband: 0.25 to 0.5 Hz

Passband ripple: less than 1 dB

Stopband attenuation: at least 40 dB

In order to transfer the digital filter coefficients
from Matlab to your C program, the following Matlab
commands are useful. Suppose `a` and `b`
are Matlab variables containing the coefficients.
These variables can be saved in text files
`a.txt` and `b.txt` as follows:

Then you can insert the filter coefficients from these files into your C program.save a.txt a -ascii -double

save b.txt b -ascii -double

** Lab Report:**
You do not have to submit a written lab report.
Instead, please demonstrate the following during lab:

- Your FIR and IIR filter designs.
Show that the
specifications are achieved by plotting the analytical
frequency response in Matlab with
`freqz`. - The algorithm that you used to implement the digital filters in the C program.
- Execute the filters on a dSPACE box, and demonstrate that they are working correctly by filtering sine waves and music.

Please begin working on your final projects. Stop in to talk with me next week about your projects if you have questions, and I will discuss your progress during lab on Friday, April 18.

Thank you.