<< Chapter < Page | Chapter >> Page > |
On the DSP, you will implement the
elliptic low-pass filter designed using the
ellip
command from
IIR
Filters: Filter-Design Exercise in MATLAB . You should
not try to implement the notch filter designed in
IIR Filtering: Filter-Coefficient
Quantization Exercise in MATLAB , because it will not
work correctly when implemented using Direct Form II. (Whynot?)
To implement the fourth-order filter, start with a single set of second-order coefficients and implement a singlesecond-order section. Make sure you write and review pseudo-code before you begin programming. Once your single second-order IIR is working properly you canthen proceed to code the entire fourth-order filter.
You may have noticed that some of the coefficients you have computed for the second-order sections are larger than 1.0in magnitude. For any stable second-order IIR section, the magnitude of the "0" and "2" coefficients( and , for example) will always be less than or equal to 1.0. However, the magnitude of the "1" coefficient can beas large as 2.0. To overcome this problem, you will have to divide the and coefficients by two prior to saving them for your DSP code. Then, in your implementation, you will have tocompensate somehow for using half the coefficient value.
Rather than write separate code for each second-order
section, you are encouraged first to write one section, thenwrite code that cycles through the second-order section code
twice using the repeat structure below. Because the IIRcode will have to run inside the block I/O loop and this
loop uses the
block repeat counter (
BRC
), you must use another looping structure
to avoid corrupting the
BRC
.
stm (num_stages-1),AR1
start_stage
; IIR code goes here
banz start_stage,*AR1-
It may be necessary to add gain to the output of the system.
To do this, simply shift the output left (which can be doneusing the
ld
opcode with its optional
shift
parameter) before saving the output to
memory.
Notification Switch
Would you like to follow the 'Dsp laboratory with ti tms320c54x' conversation and receive update notifications?