#define PI 3.1415926 #include <math.h> #include <stdio.h> #include "tms320.h" #include "dsplib.h" #define NX 200 #define NBIQ 6 DATA x[NX]; #pragma DATA_SECTION(h,".coeffs") DATAh[5*NBIQ]={5771,0,0,8192,-7727,11661,4192,9309,8192,-17462,12022,4576,8906,8192,-17061,12641,5232,8291,8192,-16448,13535,6182,7717,8192,-15877,14722,7443,7374,8192,-15538 }; #pragma DATA_SECTION(dbuffer,".dbuffer") DATA dbuffer[2*NBIQ]; DATA *dp = dbuffer; DATA r[NX]; short i; void main() { for (i=0;i<NX;i++) r[ i] =0; for(i=0;i<2*NBIQ;i++) dbuffer[ i] = 0;
for(i=0;i<NX;i++) x[ i] = 0; for(i=0;i<NX;i++)
{x[ i]=(short)((sin(PI*2000*i/22000)+sin(PI*10000*i/22000)+sin(PI*12000*i/22000)+sin(PI*20000*i/22000))*32768/4);}
iircas5(x, h, r, dp, NBIQ, NX);
while(1); }
|