<< Chapter < Page | Chapter >> Page > |
The transfer function for the second-order section shown in Lab 3: IIR Filters Overview is
First, derive the above transfer function from the block diagram. Begin by writing the difference equations for in terms of the input and past values ( and ). Then write the difference equation for also in terms of the past samples of . After finding the two difference equations, compute the corresponding Z-transforms and use the relation to verify the IIR transfer function in [link] .
Next, design the coefficients for a fourth-order filter implemented as the cascade of two bi-quad sections. Write aMATLAB script to compute the coefficients. Begin by designing the fourth-order filter and checking the responseusing the MATLAB commands
[B,A]= ellip(4,.25,10,.25)
freqz(B,A)
freqz
command displays the frequency responses of IIR filters
and FIR filters. For more information about this, type
doc freqz
. Be sure to look at MATLAB's
definition of the transfer function.freqz
command as
shown above, without passing its returned data to anotherfunction, both the magnitude (in decibels) and the phaseof the response will be shown.Next you must find the roots of the numerator,
zeros , and roots of the denominator,
poles , so that you can group them to create two
second-order sections. The MATLAB commands
roots
and
poly
will be useful for
this task. Save the scripts you use to decompose yourfilter into second-order sections; they will probably be
useful later.
Once you have obtained the coefficients for each of your two
second-order sections, you are ready to choose a
gain factor,
, for each section. As part of your MATLAB script,
use
freqz
to compute the response
with
for each of the sets of second-order coefficients.
Recall that on the DSP we do not represent numbers greaterthan or equal to 1.0. If the maximum value of
is or exceeds 1.0, an input with magnitude less
than one could produce
terms with magnitude greater than or equal to one;
this is
overflow . You must therefore select a
gain values for each second-order section such that theresponse from the input to the states,
, is always less than one in magnitude. In other
words, set the value of
to ensure that
.
After finishing Part 1, move on to Lab 3: Prelab (Part 2) , where you explore and learn how to mitigate the effects of quantization.
Notification Switch
Would you like to follow the 'Ece 420 fall 2013' conversation and receive update notifications?