Documente Academic
Documente Profesional
Documente Cultură
/*
* main() - Main code routine, initializes BSL and generates tone
*/
void main()
{
DSK6713_AIC23_CodecHandle hCodec;
int l_input, r_input;
int l_output, r_output;
/* Initialize the board support library, must be called first */
DSK6713_init();
/* Start the codec */
hCodec = DSK6713_AIC23_openCodec(0, &config);
DSK6713_AIC23_setFreq(hCodec, 1);
while(1)
{
/* Read a sample to the left channel */
while (!DSK6713_AIC23_read(hCodec,&l_input));
/* Read a sample to the right channel */
while (!DSK6713_AIC23_read(hCodec, &r_input));
l_output=(short int)adaptive_filter(l_input,r_input);
r_output=l_output;
/* Send a sample to the left channel */
while (!DSK6713_AIC23_write(hCodec, l_output));
//output=((short)dplusn);//output (desired+noise)
//overall output result
return(output);
}
PROCEDURE :
Switch on the DSP board.
Open the Code Composer Studio.
Create a new project
Project New (File Name. pjt , Eg: noisecancellation.pjt)
Initialize on board codec.
Note: Kindly refer the Topic Configuration of 6713 Codec using BSL
Add the above C source file to the current project (remove codec.c source
file from the project if you have already added).
Desired Signal 400 Hz
Noise 3.0 KHz
Input a desired sinusoidal signal into the Left channel and Noise signal of
3KHz into the Right channel
Build the project.
Load the generated object file(*.out) on to Target board.
Run the program.
Observe the waveform that appears on the CRO screen. Verify that the 3 KHz
noise signal is being cancelled gradually.