<< Chapter < Page Chapter >> Page >
This module introduces the design and implementation of IIR filters on the 56002.

Iir filter implementation

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.

Canonical biquad section

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
Direct form II canonical IIR second order section.

Filter design

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 .

Matlab suggestions

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');

Saving cycles

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.

Interrupts versus polling

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.

Data structures

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Filter design - sidney burrus style. OpenStax CNX. May 07, 2009 Download for free at http://cnx.org/content/col10701/1.1
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Filter design - sidney burrus style' conversation and receive update notifications?

Ask