|
<--
back to Lab Page
|
Lab 6: Implementation of IIR Filters ( view Lab Instructions and Requirements ) |
|
|
Aim: To study the effect of Infinite Impulse Response Filters by comparing the output of a filter obtained experimentally in Simulink to the output obtained theoretically using Matlab algorithms. x[n] is a discrete sine wave with frequency 0.2*pi and Sample time of 1 second. The IIR filter used has the following parameters: y[n] is the output of the filter |
||
ResultsExperimental A Discrete Transfer Function object is used to represent the IIR filter. To do this, b (above) is placed in the numerator of the transfer function, while a is placed in the denominator. The output of the transfer function is shown below: |
||
|
|
|
|
|
The following matlab code was used to generate the theoretical plots: ---------------IIRFilter2.m--------------- a = [1 -0.5562
0.81] %initialize the parameters of the filter y = filter (b,
a, x); %find the effect of the filter
yc = conv(x,h);
%find the effect of the filter ------------------------------------------ The first block of code initializes the parameters used in the filter function. Then these parameters and the x array are passed into the filter function and the values are stored in y which is shown below.
Another method for finding the effect of the filter is to find the impulse response of the filter (h[n]) and then convolving the impulse response and the input, x. Find the impulse response by making the input to the filter the impulse function (delta) which is 1 at n=0 (n=1 for matlab) and zero everywhere else. Because this is an IIR filter, the impulse response should be infinite. But the filter function only produces as many h values as there are x values. The impulse response is shown below:
The impulse response is convolved with the input x. The results are shown below:
Conclusion The IIR filter produces a signal that dies out with time. This can be explained by the impulse response which also dies out with time. This phenomenum is seen in the experimental plot as well as the two theoretical plots. The results produced by the different methods are identical. |
||
| Web Design: © 2001 Nathaniel
Ayewah
natayewah@hotmail.com Last Updated: November 21, 2001 |
||