Summary: You will derive the transfer function of a second-order, Direct Form II, infinite impulse response (IIR) filter. Then you will create a fourth-order IIR filter, plot its frequency response, and decompose the fourth-order filter into two second-order sections, choosing an appropriate gain for each stage to prevent overflow.
Note: Your browser may not currently support MathML. See our browser support page for additional details. You can always view the correct math in the PDF version.
The transfer function for the second-order section shown in IIR Filtering: Introduction is
First, derive the above transfer function. Begin by writing
the difference equations for
Next, design the coefficients for a fourth-order filter implemented as the cascade of two bi-quad sections. Write a MATLAB script to compute the coefficients. Begin by designing the fourth-order filter and checking the response using 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
help freqz. Be sure to look at MATLAB's
definition of the transfer function. freqz command as
shown above, without passing its returned data to another
function, both the magnitude (in decibels) and the phase
of 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 your
filter 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,
freqz to compute the response
As the processor exercises become more complex, it will
become increasingly important to observe good programming
practices. Of these, perhaps the most important is careful
planning of your program flow, memory and register use, and
testing procedure. Write out pseudo-code for the processor
implementation of a bi-quad. Make sure you consider the way
you will store coefficients and states in memory. Then, to
prepare for testing, compute the values of
"Doug course at UIUC using the TI C54x DSP has been adopted by many EE, CE and CS depts Worldwide "