Question: Here is the task and below is the Reference Design CCS project code. Task: Make a Duplicate of the Reference Design CCS project and start
Here is the task and below is the Reference Design CCS project code.
Task: Make a Duplicate of the Reference Design CCS project and start modifying the duplicate.
Create MyFilter menu item in CCS project and implement the filter you designed flash to the board.
Your filter should run in the DSP and be accessible through buttons S and SPlace your filter first in the reference design menu system.
Test the design using the board and eg mm Ycable mic speaker separated
Input noisy signalOutput clear signal and test it with using the eg Android app called Spectroid.
Deliverables: two files can be zipped together
Report on the Texas Instruments DSP project implementation with Screenshots min pages, Screenshot from a Spectroid application from where we can see, that the noise "spike" has gone
CCS code for implementing the filter
Code:
#include
#include "application.h
Define buffer size
#define BUFFERSIZE
Define pushbutton configurations
#define PUSHBUTTONPORT P
#define PUSHBUTTONPIN BIT
#define PUSHBUTTONIFG PIFG
#define PUSHBUTTONPORT P
#define PUSHBUTTONPIN BIT
#define PUSHBUTTONIFG PIFG
Global variables
bool enableFilter false; Filter control flag
float audioBufferBUFFERSIZE; Audio buffer for processing
float filterHistory; History for lowpass filter
Function prototypes
void initClockvoid;
void initGpiovoid;
void RunMyFiltervoid;
Lowpass filter implementation
float lowPassFilterfloat input, float history
const float a a; Coefficients
float output a input a history;
history input; Update history
return output;
Run "MyFilter" function
void RunMyFiltervoid
for int i ; i BUFFERSIZE; i
if enableFilter
audioBufferi lowPassFilteraudioBufferi filterHistory;
Main function
int mainvoid
WDTCTL WDTPW WDTHOLD; Stop watchdog timer
initClock;
initGpio;
PMCTL & ~LOCKLPM; Clear lock bit
while
RunMyFilter; Process audio
return ;
Initialize clock
void initClockvoid
PJSEL BIT BIT; XT
CSCTLH CSKEY ; Unlock CS registers
CSCTL DCOFSEL; Set DCO to MHz
CSCTL SELALFXTCLK SELSDCOCLK SELMDCOCLK;
CSCTL DIVA DIVS DIVM; Set dividers
CSCTL & ~LFXTOFF;
do
CSCTL & ~LFXTOFFG; Clear fault flags
SFRIFG & ~OFIFG;
while SFRIFG & OFIFG; Wait for stabilization
CSCTLH ; Lock CS registers
Initialize GPIO
void initGpiovoid
POUT x;
PDIR xFF;
POUT x;
PDIR xFF;
Configure pushbuttons
GPIOsetAsInputPinWithPullUpResistorPUSHBUTTONPORT, PUSHBUTTONPIN;
GPIOselectInterruptEdgePUSHBUTTONPORT, PUSHBUTTONPIN, GPIOHIGHTOLOWTRANSITION;
GPIOsetAsInputPinWithPullUpResistorPUSHBUTTONPORT, PUSHBUTTONPIN;
GPIOselectInterruptEdgePUSHBUTTONPORT, PUSHBUTTONPIN, GPIOHIGHTOLOWTRANSITION;
Interrupt handlers for buttons
void PORTIRQHandlervoid
if PUSHBUTTONIFG & PUSHBUTTONPIN Button S pressed
enableFilter true; Enable filter
GPIOclearInterruptPUSHBUTTONPORT, PUSHBUTTONPIN;
if PUSHBUTTONIFG & PUSHBUTTONPIN Button S pressed
enableFilter false; Disable filter
GPIOclearInterruptPUSHBUTTONPORT, PUSHBUTTONPIN;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
