/***************************************************************** * iir_fixpt_c55x.c- Fixed-point C program for IIR filtering using * direct-form II biquads in C55x assembly functions * in Section 7.7.6.2 ****************************************************************** * System configuration: * * in(n) |----------------| out(n) * ---->| Bandpass filter|-----> * |----------------| * * in(n) is the input data from data file "in_int_ccs.dat" * This C program called two functions written in C55x assembly * *****************************************************************/ #include #include #include #include "iircoeff_ccs_16.h" // coefficient header file int in_buffer[300]; int out_buffer[300]; #define TRUE 1 extern void gain_c55x(int *,int *,int ); extern void iir_c55x(int *,const int16_T *,const int16_T *,int *); /*Function */ static int iirproc(int *input, int *output); static void dataIO(void); void main() { /*************************************************************** * Declare file pointers ***************************************************************/ int *input = &in_buffer[0]; int *output= &out_buffer[0]; /*************************************************************** * Start of main program ***************************************************************/ while(TRUE) { /* read in x(n) from data file and processing it */ dataIO(); iirproc(input, output); } } /* Function for IIR filtering */ static int iirproc(int *input, int *output) { /*************************************************************** * Define variable arrays, define and clear variables ***************************************************************/ const int section = 3; int out = 0; /* y(n), output from IIR filter */ int delay[9] = {0,0,0,0,0,0,0,0,0}; int gain = 17; int j,i; int size = 300; for(i=0;i