From e7b24dd7da9de84e218f7d7be623f0cf8b9d1b9c Mon Sep 17 00:00:00 2001 From: "N.N." Date: Mon, 17 Feb 2003 14:12:16 +0000 Subject: This commit was generated by cvs2svn to compensate for changes in r415, which included commits to RCS files with non-trunk default branches. svn path=/trunk/externals/dfx/; revision=416 --- dfx-library/FIRfilter.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 dfx-library/FIRfilter.h (limited to 'dfx-library/FIRfilter.h') diff --git a/dfx-library/FIRfilter.h b/dfx-library/FIRfilter.h new file mode 100755 index 0000000..d0f763b --- /dev/null +++ b/dfx-library/FIRfilter.h @@ -0,0 +1,37 @@ +#ifndef __FIRfilter +#define __FIRfilter + +#include + + +#define PI 3.1415926535897932384626433832795f +#define SHELF_START_FIR 0.333f + + +//----------------------------------------------------------------------------- +void calculateFIRidealLowpassCoefficients(float cutoff, float samplerate, + int numTaps, float *coefficients); +void applyKaiserWindow(int numTaps, float *coefficients, float attenuation); +float besselIzero(float in); +float besselIzero2(float in); + +//----------------------------------------------------------------------------- +inline float processFIRfilter(float *in, int numTaps, float *coefficients, + long inPos, long arraySize) +{ + float out = 0.0f; + if ( (inPos+numTaps) > arraySize ) + { + for (long i=0; i < numTaps; i++) + out += in[(inPos+i)%arraySize] * coefficients[i]; + } + else + { + for (long i=0; i < numTaps; i++) + out += in[inPos+i] * coefficients[i]; + } + return out; +} + + +#endif \ No newline at end of file -- cgit v1.2.1