/******************************************************************* * FIR - This C function performs FIR filtering operation as: * ntap-1 * y(n) = sum wi * x(n-i) * i=0 *******************************************************************/ float fir(x, w, ntap) float *x, *w; // signal & coefficient pointers int ntap; // length of filter { float yn; // output of FIR filter int i; // index yn = 0.0; // y(n) = 0. for (i=0; i