#include #ifndef FAD_MAX_SAMPLES #warning FAD_MAX_SAMPLES not defined. defining: FAD_MAX_SAMPLES to 1024 #define FAD_MAX_SAMPLES 1024 #endif // source vector is // float Ameas[FAD_MAX_SAMPLES]; void factfir(double b, vector &a, int k, vector &source, vector &dest){ //dest.clear(); for (int slice =0; slice < FAD_MAX_SAMPLES; slice++) { float currentval = 0; for (int i=0; i < k ; i++){ currentval += a[i] * source[ (slice - i + FAD_MAX_SAMPLES) % FAD_MAX_SAMPLES ]; } dest[slice] = currentval / b; } }