ECE 5760: Laboratory 2

Audio filtering using multiple small cpus.


In this assignment you will implement audio filters for both channels of an audio signal. Each channel will be filtered by software running on two separate cpus. The filter center frequency and bandwidth will be settable from switches on the DE2. The filtered audio will be sent back out throught the audio codec for analysis and listening.


  1. You must handle the boards only on on the ESD mat. These boards are expensive and you must be careful of them.

  2. Make sure the Altera DE2 board is connected to power and to the PC as specified in the evaluation board description. Turn on the power supply with the red switch on the board. Make sure the toggle switch on the left edge of the board marked (Run/Prog) is in the Run position and leave it there at all times. The FPGA will program in the Run position. Putting the switch in the Prog position writes your design to flash memory, which you do not want to do.

  3. The default top level module for the DE2 defines all of the logical i/o signals.

  4. You can define the mapping from logical signal to FPGA pins (pin assignment in QuartusII) for all the pins at once by importing this file using the menu item Assignments... Import Assignments... and specifying the file name. There is no need to define pins one-by-one.

  5. The hardware audio interface is a Wolfson WM8731 codec which is controlled by an I2C interface. I have simplified the drivers somewhat. The cleanest version is in this project zip. The context for the drivers is explained in the DSP page, example 1. Note that the DSP page describes hardware filters. In this lab you are going to build software filters.The audio codec produces (and outputs) 16-bit 2's complement numbers. The 16-bit numbers should be considered as fractional values in the range +1 to -1 volt.

  6. The cpu you will use is described on the stack cpu page. A compiler is also described there which uses a stack language. The cpu I built has a multiplier designed for 10:8 fixed point. You may want to modify this to 2:16 for better filter accuracy. A matlab code which converts filter specification to 2:16 fixed point is here. There are two basic operations to perform to do the conversion:
    1. multiply the coefficients by 216,
    2. scale all coefficients if any are bigger than 2.0. If you need to do this, you will have to modify the code running on your cpu to divide the sample output by the scale factor.

--Using QuartusII SignalTap tool to verify your design.

Here are the steps that seem to be necssary to get SignalTap working. For more information, read the Altera tutorial on using SignalTap, an on chip logic analyzer.

  1. Choose menu Tools>SignalTap
  2. In the main SignalTap window, click Hardware Setup... (in the upper rigtht corner)
    and in the dialog box choose the hardware (USB-Blaster)
  3. Choose menu Edit>AddNodes...
    1. Choose the appropriate Filter to simplify the list of nodes, the press List
    2. Highlight nodes and move to right-hand list using > button
    3. Click OK to get back to main SignalTap window
  4. In the main SignalTap window, click the Clock ... button and choose the clock signal as in AddNodes
  5. In the node panel of the main window, set up trigger conditions.
  6. Compile and then load the design onto the FPGA
  7. In the main SignalTap window, toggle the Data/Setup button
  8. Choose menu Processing >Run Analysis


Be prepared to separately demo your flter design to your TA in lab.

Your written lab report should include the sections mentioned in the policy page, and :

Copyright Cornell University September 21, 2011