Skip to content Skip to navigation

Connexions

You are here: Home » Content » IIR Filtering Using the DSP56002

Navigation

Content Actions

  • Download module PDF
  • Add to ...
    Add the module to:
    • My Favorites
    • A lens
    • An external social bookmarking service
    • My Favorites (What is 'My Favorites'?)
      'My Favorites' is a special kind of lens which you can use to bookmark modules and collections directly in Connexions. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need a Connexions account to use 'My Favorites'.
    • A lens (What is a lens?)

      Definition of a lens

      Lenses

      A lens is a custom view of Connexions content. You can think of it as a fancy kind of list that will let you see Connexions through the eyes of organizations and people you trust.

      What is in a lens?

      Lens makers point to Connexions materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

      Who can create a lens?

      Any individual Connexions member, a community, or a respected organization.

    • External bookmarks
  • E-mail the author

Recently Viewed

This feature requires Javascript to be enabled.

IIR Filtering Using the DSP56002

Module by: Lee Potter

Summary: 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 a sinewave 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 Figure 1 and a sequence of diagrams as in Figure 2 to explain the execution of a single biquad section. Express the value of the accumulator at each step in terms of xn x n , wn w n , and yn 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
	
      
Figure 1: Direct form II canonical IIR second order section.
Figure 1 (iir_fig1.png)

Filter design

A speech signal has been recorded in the presence of a loud, annoying, high frequency hum. Measurements have indicated that 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 operation using the oscilloscope and speakers. Compare the computational cost of your IIR filter on the 56002 to the FIR design 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. Your report should comment on your design choices. Plot both magnitude and phase responses. The reject band can be plotted 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 the number of free cycles remaining per sampling period. Use the A accumulator to count the number of cycles not used in implementing the IIR filter. Store and reset the accumulator value as part of your interrupt routine.

Figure 2: Data structures
Figure 2 (iir_fig2.png)

Comments, questions, feedback, criticisms?

Send feedback