This is my main coding
AM-double sideband suppressed carrier
and i need to add the filter method to extract one of the two sidebands.
//AM.c
#include "DSK6713_AIC23.h" //codec-dsk support file
Uint32 fs=DSK6713_AIC23_FREQ_8KHZ; //set sampling rate
short amp = 1; //index for modulation
void main()
{
short baseband[20]={1000,951,809,587,309,0,-309,-587,-809,-951,
-1000,-951,-809,-587,-309,0,309,587,809,951}; //400-Hz baseband
short carrier[20] ={1000,0,-1000,0,1000,0,-1000,0,1000,0,
-1000,0,1000,0,-1000,0,1000,0,-1000,0}; //2-kHz carrier
short output[20];
short k;
comm_poll(); //init DSK, codec, McBSP
while(1) //infinite loop
{
for (k=0; k<20; k++)
{
output[k]=((amp*baseband[k]*carrier[k]/10)>>12);
output_sample(20*output[k]); //scale output
}
}
}
Below this is filter coding , but it cannot add simply like that. i try it before much time and edit , but there have error -(expected a declaration , exppected an expression) and i not familiar in coding.so need some help or assists or some answer.
.
. ( include file )
.
interrupt void c_int11() //ISR
{
short i;
dly[0] = input_sample(); //new input @ beginning of buffer
yn = 0; //initialize filter's output
for (i = 0; i< N; i++)
yn += (h * dly); //y(n) += h(i)* x(n-i)
for (i = N-1; i > 0; i--) //starting @ end of buffer
dly = dly[i-1]; //update delays with data move
output_sample(yn >> 15); //scale output filter
return;
}
void main()
{
comm_intr(); //init DSK, codec, McBSP
while(1); //infinite loop
}