Lab 8: IQmath FIR Filter
Select a Global IQ value
6. Open the file
c:\tidcs\c28\IQmath\cIQmath\include\IQmathLib.h.
Confirm that the
GLOBAL_Q
type (near beginning of file) is set to a value of 24. If it is
not, modify as necessary:
#define GLOBAL_Q 24
Recall that this Q type will provide 8 integer bits and 24 fractional bits. Dynamic range
is therefore -255 < x < +255, which is sufficient for our purposes in the workshop.
IQmath Single-Sample FIR Filter
7. Open and inspect
DefaultIsr_8.c
. Notice that the ADCINT_ISR calls the IQmath
single-sample FIR filter function, IQssfir(). The filter coefficients have been defined in
the beginning of the file. Now open and inspect the IQssfir() function in
Filter.c
.
This is a simple, unoptimized coding of a basic IQmath single-sample FIR filter.
Build and Load
8. Click
the
“Build”
button.
9. Reset the DSP.
Run the Code – Filtered Waveform
10. Open a memory window to view some of the contents of the filtered ADC results buffer.
The address label for the filtered ADC results buffer is
AdcBufFiltered
. Set the Q-Value
to
24
(which matches the IQ format being used for this variable) and the Format to
32-Bit
Signed Int
. We will be running our code in real-time mode, and need to have our window
continuously refresh. Enable
Real-time Mode
and be sure that the
Global
Continuous Refresh
option has been checked.
Note:
For the next step, check to be sure that the jumper wire connecting “VREFLO”
(pin # P9-18) to “GND” (pin # P9-17) and the wire connecting PWM1 (pin # P8-9) to
ADCIN0 (pin # P9-2) are still in place on the eZdsp™.
11. Run the code in real-time mode and watch the memory window update. Verify that the
ADC result buffer contains updated values.
12. Open and setup a dual time graph to plot a 50-point window of the filtered and unfiltered
ADC results buffer. Click:
View Graph Time/Frequency…
and set the
following values:
8 - 38
C28x - Numerical Concepts & IQmath
Summary of Contents for C28 Series
Page 64: ...Summary 3 16 C28x Peripheral Registers Header Files ...
Page 78: ...Interrupt Sources 4 14 C28x Reset and Interrupts ...
Page 218: ...Lab 9 DSP BIOS 9 22 C28x Using DSP BIOS ...
Page 244: ...Lab 10 Programming the Flash 10 26 C28x System Design ...
Page 273: ...Appendix A eZdsp F2812 C28x Appendix A eZdsp F2812 A 1 ...
Page 276: ...Appendix P2 Expansion Interface A 4 C28x Appendix A eZdsp F2812 ...
Page 277: ...Appendix P4 P8 P7 I O Interface C28x Appendix A eZdsp F2812 A 5 ...
Page 278: ...Appendix A 6 C28x Appendix A eZdsp F2812 ...
Page 279: ...Appendix P5 P9 Analog Interface C28x Appendix A eZdsp F2812 A 7 ...
Page 282: ...Appendix A 10 C28x Appendix A eZdsp F2812 TP1 TP2 Test Points ...