/**************************************************************** * datamov.c - This function updates signal vector for FIR filter ****************************************************************/ void datamov(x, L, input) float *x; // signal vector int L; // length of vector float input; // newest input sample { int i; // loop index for (i=L-1; i>0; --i) { x[i] = x[i-1]; // shift old data x(n-i), i = 1, 2, ... L-1 } // such as x(0) -> x(1), etc. x[0] = input; // insert new data x(n) into x(0) }