#include "cmd_fir1p.h" #define FIR_SIZE 12 double fir_coef[FIR_SIZE] = { -0.0044384, -0.0041841, 0.0130183, 0.0746628, 0.1720210, 0.2489204, 0.2489204, 0.1720210, 0.0746628, 0.0130183, -0.0041841, -0.0044384 }; #define MAX_INPUT_LEN 80 #define BUFFER_LEN (FIR_SIZE-1+MAX_INPUT_LEN) double insamp[BUFFER_LEN]; int fir1filter(double *coeffs, double *input, double *output, int length, int filter_length) { double acc; double *coeffp; double *inputp; int n; int k; memcpy(&insamp[filter_length-1], input, length*sizeof(double)); for (n=0; n