[Lui's homepage] [DSP homepage]
Lab Exercise:
A Low Pass Filter
In this exercise you are to implement a low pass filter on the 'C542. The filter is a causal linear time-invariant system with a finite impulse response, h(n), with nonzero values only in the range n = 0, 1, ..., 31:
h ( 0) = h(31) = -0.007141978 h ( 1) = h(30) = -0.003070801 h ( 2) = h(29) = 0.005891327 h ( 3) = h(28) = 0.01349923 h ( 4) = h(27) = 0.008087033 h ( 5) = h(26) = -0.01107258 h ( 6) = h(25) = -0.02420687 h ( 7) = h(24) = -0.009446550 h ( 8) = h(23) = 0.02544464 h ( 9) = h(22) = 0.03985050 h(10) = h(21) = 0.002753036 h(11) = h(20) = -0.05913959 h(12) = h(19) = -0.06841660 h(13) = h(18) = 0.03175741 h(14) = h(17) = 0.2080981 h(15) = h(16) = 0.3471138 The way these coefficients are obtained from a desired frequency response is described in sec 8.2 of [Proakis and Manolakis]. The coefficients are also listed in Table 8.4.
Each output is computed from 32 input samples, consisting of the current sample, and the 31 samples immediately preceding it. Hence, input samples need to be stored into a buffer of size at least 32.
Use Excel to verify that the LTI system described is a low pass filter.
Implement the LTI system on the 'C542 using a circular buffer. Use the circular addressing mode in accessing the buffer's contents.
Simulate input by generating samples of the DTMF tone assigned to you in lab exercise 5. [tone assignments]. Have the DTMF tone generator place the samples it produces into the circular buffer instead of sending the samples to the DAC. Then have the low pass filter process the samples that were placed in the circular buffer by the DTMF tone generator. Send the output of the lowpass filter to the DAC.
Use Excel to verify that the LTI system described is a low pass filter. Predict the output of the filter by simulating the low pass filter in Excel with the DTMF tone assigned to you as input.
Be able to show that the output of the LTI system are really those required. Do this by simulating in Excel the computations involved, and by inserting code somewhere before interrupts are enabled, and before your firmware goes into an infinite loop. It should be possible, by stepping thru this code fragment, to compare the samples generated by this code fragment with the results of a simulation of the same computations in Excel.
You should have the following during evaluation of this lab exercise:
- an Excel verification that the LTI system is a low pass filter
- an Excel simulation of the action of the low pass filter on the DTMF tone assigned to you.
- the 'C542 code implementing the LTI system, with a simulated DTMF tone input
- verification that the LTI system as implemented on the 'C542 is consistent with the Excel simulation
Be able to answer all questions related to this exercise.
This page has been accessed
times since September 22, 2003.