/***************************************************************** * ale_fixpt_c55x.c - Fixed-point C program for ALE on C5000 CCS * using C55x assembly routines ****************************************************************** * System configuration: * * d(n) --------------------------- * | / | * d(n-1)|----------------| out(n) V * ---->| ALE (LMS-FIR) |-----> |+|------> * |----------------| - | * /________________________| * * * d(n) is the input data from data file "in_int_ccs.dat" * *****************************************************************/ #include #include #include int in_buffer[500]; int out_buffer[500]; int err_buffer[500]; #define TRUE 1 /* Functions used in this programs */ extern void shift_c55x(int *,int , int ); extern void adapt_c55x(int *,int *,int *,int ,int ,int * ); static int aleproc(int *input, int *output, int *error); static void dataIO(void); void main() { /*************************************************************** * Declare file pointers ***************************************************************/ int *input = &in_buffer[0]; int *output= &out_buffer[0]; int *error= &err_buffer[0]; /*************************************************************** * Start of main program ***************************************************************/ while(TRUE) { /* read in x(n) from data file and processing it */ dataIO(); aleproc(input, output, error); } } /* Function aleproc for ALE processing */ static int aleproc(int *input, int *output, int *error) { /*************************************************************** * Define variable arrays, define and clear variables ***************************************************************/ #define NL 16 /* length of FIR filter */ int yn = 0; /* y(n), output from the filter */ int xnbuf[16+1]; /* extra memory location for the shift */ int w[16]; int k; int mu = 1000; /* 33(0.001); 338(0.01); 655(0.02) */ int err; int dn = 0; int size = 500; /*************************************************************** * Start of main program ***************************************************************/ for(k=0; k