#define FFT_SIZE 2048 #define FIR_ORDER 16 typedef struct { long *coeff_ptr; /* Pointer to Filter coefficient */ long *dbuffer_ptr; /* Delay buffer ptr */ int cbindex; /* Circular Buffer Index */ int order; /* Order of the Filter */ int input; /* Latest Input sample */ int output; /* Filter Output */ void (*init)(void *); /* Ptr to Init funtion */ void (*calc)(void *); /* Ptr to calc fn */ }FIR16; FIR16 fir; int Buff_acq[4*FFT_SIZE]; int Spectro[(FFT_SIZE/2)+1]; int coeff_fidl[17]={ 0.0090*32767, 0.0131*32767, 0.0245*32767, 0.0416*32767, 0.0618*32767, 0.0822*32767, 0.0994*32767, 0.1109*32767, 0.1150*32767, 0.1109*32767, 0.0994*32767, 0.0822*32767, 0.0618*32767, 0.0416*32767, 0.0245*32767, 0.0131*32767, 0.0090*32767 }; int coeff_lb[17]={ 0.05850*32767, 0.05850*32767, 0.05850*32767, 0.05850*32767, 0.05850*32767, 0.05850*32767, 0.05850*32767, 0.05850*32767, 0.05850*32767, 0.05850*32767, 0.05850*32767, 0.05850*32767, 0.05850*32767, 0.05850*32767, 0.05850*32767, 0.05850*32767, 0.05850*32767}; void fir_od16(int *src, int *coeff, int size) { int i; long dbuffer[FIR_ORDER+1]; fir.init=(void (*)(void *))FIR32_init; fir.calc=(void (*)(void *))FIR32_calc; fir.order=FIR_ORDER; fir.dbuffer_ptr=dbuffer; fir.coeff_ptr=(long *)coeff; fir.init(&fir); for (i=0;i