| 1 | #pragma once |
| 2 | |
| 3 | #include <stdint.h> |
| 4 | #include <stdbool.h> |
| 5 | |
| 6 | typedef struct onePoleFilter_t |
| 7 | { |
| 8 | float tmpL, tmpR, a0, b1; |
| 9 | } onePoleFilter_t; |
| 10 | |
| 11 | typedef struct twoPoleFilter_t |
| 12 | { |
| 13 | float tmpL[4], tmpR[4], a1, a2, b1, b2; |
| 14 | } twoPoleFilter_t; |
| 15 | |
| 16 | void setupOnePoleFilter(double audioRate, double cutOff, onePoleFilter_t *f); |
| 17 | void clearOnePoleFilterState(onePoleFilter_t *f); |
| 18 | void onePoleLPFilterStereo(onePoleFilter_t *f, const float *in, float *out); |
| 19 | void onePoleHPFilterStereo(onePoleFilter_t *f, const float *in, float *out); |
| 20 | void onePoleLPFilter(onePoleFilter_t *f, const float in, float *out); |
| 21 | void onePoleHPFilter(onePoleFilter_t *f, const float in, float *out); |
| 22 | |
| 23 | void setupTwoPoleFilter(double audioRate, double cutOff, double qFactor, twoPoleFilter_t *f); |
| 24 | void clearTwoPoleFilterState(twoPoleFilter_t *f); |
| 25 | void twoPoleLPFilter(twoPoleFilter_t *f, const float in, float *out); |
| 26 | void twoPoleLPFilterStereo(twoPoleFilter_t *f, const float *in, float *out); |