Digital Filters

Laboratory home page
Aim of the Experiment

A goal of this experiment is to design discrete-time digital filters and implement them in real time.

In this experiment you will see the special architectural features of digital signal processors such as circular buffers that make the processors well suited for signal processing. You will implement different digital filters using in two different programming approaches:

In this experiment, you will construct finite impulse response (FIR) filters and infinite impulse response (IIR) filters on the DSP. For the FIR filter implementation, you will use the C-based convolution routine as well as the two assembly routines provided for you.

The response of these filters will be measured by

Equipment to be checked out

All the above equipment can be checked out from the checkout in the second floor. The above list of equipment is the equipment required per work station.

Reading assignment


Downloads

Recitation slides part 1, part 2 and part 3 by Mr. Chao Jia and Ms. Debarati Kundu, The University of Texas at Austin

Lab #3 instructions part 1, part 2 and part 3 by Mr. Chao Jia and Ms. Debarati Kundu, The University of Texas at Austin

FIRmono_ISRs.c

Assembly code files convol1.sa and convolve.sa

LabVIEW transmitter demonstration by Dr. Zukang Shen to show how labs 1-6 fit together

Overview Slides by Prof. Steven Tretter, University of Maryland (from Jan. 2008 lab manual)


Lab Report

All measurements and findings should be in lab report (cycle counts, frequency response, phase responses, etc.). In addition, please answer the following questions:

  1. Number of taps before you run out of time for FIR filtering.
  2. Why use circular buffers?
  3. What happens if you do not multiply the scale factor in an IIR filter implementation using a cascade of second-order sections (SOS)?
  4. Advantages and disadvantages of FIR vs. IIR filters.
Note from second week of lab: The frame-based FIR program filters both the left and the right channel, and the sample based FIR filter filters only one channel. So, the number of machine cycles for frame-based filtering should be divided by two in order to be compared with the corresponding value for sample-based filtering.

Milestones to Demonstrate to the TA

After each one of these parts, show them to the TA:

Coding Guidelines

For this lab, it is especially important to realize that the addition of an element into a circular array and the actual convolution calculation are two entirely separate operations.

Labs 5, 6, and 7 will directly involve performing multiple convolutions for FIR filters, so it makes sense to go ahead and put the Lab #3 convolution routine in a function.

As mentioned on the code grading page, the use of the C modulo operator "%" is discouraged and will be penalized.


Debugging and Troubleshooting Tips

When connecting the USB cable from the PC to the C6748 DSP board, please use the USB port on the opposite side of the board from the power connector.

Here are troubleshooting tips for Code Composer Studio v4.

Here are general tips for debugging and troubleshooting:

  1. Remez filter is just "equiripple" in fdatool.
  2. Please notice which channel are you using when reading samples from signal generator. You can also use T connector to feed both channels with signal.
  3. Some students found that the frame-based FIR filter yielded a larger number of machine cycles compared to sample-based FIR filtering. The frame based FIR program filters both the left and the right channel, and the sample based FIR filter filters only one channel. So, the number of machine cycles for frame-based filtering should divided by two in order to be compared with the corresponding value for sample-based filtering.

When seeing an incorrect output on the oscilloscope, the cause may be one of the following:

  1. Changed the sampling rate in Interrupt Service Routine (isr) file but forgot to change it in the configuration file. The sampling frequency specified in isr file is only used for computation.
  2. The interrupt is not working. Even though the interrupt is not working, the oscilloscope could still show sinusoidal-like noise. This can be easily checked by measuring the magnitude of the waveform, and knowing that noise should have a very small magnitude.
  3. Using the single-channel versions of ReadSample(data) and WriteSample(data) defined in the files for lab 3. These functions have bugs in them. Instead, use the two-channel versions ReadSample(left, right) and WriteSample(left, right).

For IIR filter implementation, a common mistake is to forget to negate the feedback coefficients. For a biquad, the difference equation for the output y[n] given the input x[n] is

 
y[n] = a1 y[n-1] + a2 y[n-2] + b0 x[n] + b1 x[n-1] + b2 x[n-2]
The transfer function, which assumes zero-valued initial conditions, is
 
         -1      -2
b0 + b1 z  + b2 z  
-------------------
        -1      -2
1 - a1 z  - a2 z   
Note the negative signs in front of a1 and a2.


Assignment

Submitting this assignment is optional, but doing it would be useful with your QUIZ preparations

Assignment

Back to the course home page


Next Experiment

Previous Experiment