Digital Signal Processing Reference
In-Depth Information
dly[i][1] = dly[i][0]; //update delays
dly[i][0] = un; //update delays
input = yn; //intermediate output->input to next stage
}
output_sample(yn); //output final result for time n
return;
//return from ISR
}
void main()
{
comm_intr();
//init DSK, codec, McBSP
while(1);
//infinite loop
}
Digital filtering with FIR Notch filter
//NOTCH2.C Two FIR notch filters to remove two sinusoidal
noise signals
#include “BS900.cof” //BS @ 900 Hz coefficient file
#include “BS2700.cof” //BS @ 2700 Hz coefficient file
short dly1[N]={0}; //delay samples for 1st filter
short dly2[N]={0}; //delay samples for 2nd filter
int y1out = 0, y2out = 0; //init output of each filter
short out_type = 1; //slider for output type
interrupt void c_int11() //ISR
{
short i;
dly1[0] = input_sample(); //newest input @ top of
buffer
y1out = 0; //init output of 1st filter
y2out = 0; //init output of 2nd filter
for (i = 0; i< N; i++)
y1out += h900[i]*dly1[i]; //y1(n)+=h900(i)*x(n-i)
dly2[0]=(y1out >>15); //out of 1st filter->in 2nd
filter
for (i = 0; i< N; i++)
 
Search WWH ::




Custom Search