diff options
author | N.N. <martin_pi@users.sourceforge.net> | 2003-02-17 14:12:16 +0000 |
---|---|---|
committer | N.N. <martin_pi@users.sourceforge.net> | 2003-02-17 14:12:16 +0000 |
commit | e7b24dd7da9de84e218f7d7be623f0cf8b9d1b9c (patch) | |
tree | d6f37e159464589e9c5c3dea8b38e4d03631794c /dfx-library/FIRfilter.h |
This commit was generated by cvs2svn to compensate for changes in r415,svn2git-root
which included commits to RCS files with non-trunk default branches.
svn path=/trunk/externals/dfx/; revision=416
Diffstat (limited to 'dfx-library/FIRfilter.h')
-rwxr-xr-x | dfx-library/FIRfilter.h | 37 |
1 files changed, 37 insertions, 0 deletions
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 <math.h> + + +#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 |