<< Chapter < Page | Chapter >> Page > |
The program
iir.asm
implements a real-time
IIR
lowpass filter ; the ADC
procedure is the same as used for the FIR filter in
FIR Filtering . The example IIR
filter is found in
El-Sharkawy Appendix F, Section
6 . Assemble, link, load and execute this routine;
observe the frequency response passband edge frequency using asinewave input to the EVM.
Consider the seven instructions in
iir.asm
(
shown below ) that implement cascaded
second order sections of the IIR filter. For a single section
nsec=1
use the flow diagram in
and a sequence of diagrams as in
to explain the execution of a single biquad
section. Express the value of the accumulator at each step interms of
$x(n)$ ,
$w(n)$ , and
$y(n)$ .
mpy y0,y1,a x:(r0)+,x0 y:(r4)+,y0
do #nsec,_ends
mac x0,y0,a x:(r0)-,x1 y:(r4)+,y0
macr x1,y0,a x1,x:(r0)+ y:(r4)+,y0
mac x0,y0,a a,x:(r0) y:(r4)+,y0
mac x1,y0,a x:(r0)+,x0 y:(r4)+,y0
mac x0,y0,a x:(r0)+,x0 y:(r4)+,y0
_ends
A speech signal has been recorded in the presence of a loud,
annoying, high frequency hum. Measurements have indicatedthat the noise energy is isolated to frequencies in the range
of 2850Hz to 2950Hz. Use Matlab to design an IIR
notch
filter to remove these unwanted components. Design the
filter for a
sampling rate of 16kHz; set the DSP
sampling rate to 16kHz in the file
ada_init.asm
.
Implement this filter on the 56002 and verify its operationusing the oscilloscope and speakers. Compare the
computational cost of your IIR filter on the 56002 to the FIRdesign from the
FIR Filtering
Lab .
Use either
Butterworth or
Elliptic designs with a
'stop'
bandreject option. Try a
60dB
stopband attenuation as a starting point.
Be careful with signs on denominator coefficients. Yourreport should comment on your design choices. Plot both
magnitude and phase responses. The reject band can beplotted using these commands:
[h,w]=freqz(b,a,1024);
hold off;
plot(w*8000/pi,20*log10(abs(h)));
axis([2400 3400 -80 0]);
grid;
hold on;
plot([2850 2850],[0 -80],'r');
plot([2950 2950],[0 -80],'r');
xlabel('frequency, Hz');
ylabel('magnitude response, dB');
Modify your program to avoid the reset of
r0
and
r1
inside the filtering loop in
iir.asm
. See
Page 165 of
El-Sharkawy for comments on
modulo
addressing and the
dsm
assembler
directive.
Rewrite your program to implement filtering using
interrupts , in contrast to the
polling used in
iir.asm
. The
routines within
txrx_isr.asm
can be modified for
this purpose. The main loop of your program should count thenumber of free cycles remaining per sampling period. Use the
A accumulator to count the number of cycles not used inimplementing the IIR filter. Store and reset the accumulator
value as part of your interrupt routine.
Notification Switch
Would you like to follow the 'Filter design - sidney burrus style' conversation and receive update notifications?