PortAudio  2.0
biquad_filter.h
Go to the documentation of this file.
1 #ifndef _BIQUADFILTER_H
2 #define _BIQUADFILTER_H
3 
4 
11 #define BIQUAD_MIN_RATIO (0.000001)
12 #define BIQUAD_MIN_Q (0.00001)
13 
14 typedef struct BiquadFilter_s
15 {
16  double xn1; // storage for delayed signals
17  double xn2;
18  double yn1;
19  double yn2;
20 
21  double a0; // coefficients
22  double a1;
23  double a2;
24 
25  double b1;
26  double b2;
27 
28  double cos_omega;
29  double sin_omega;
30  double alpha;
31 } BiquadFilter;
32 
33 void BiquadFilter_SetupHighPass( BiquadFilter *filter, double ratio, double Q );
34 void BiquadFilter_SetupNotch( BiquadFilter *filter, double ratio, double Q );
35 
36 void BiquadFilter_Filter( BiquadFilter *filter, float *inputs, float *outputs, int numSamples );
37 
38 #endif
double sin_omega
Definition: biquad_filter.h:29
struct BiquadFilter_s BiquadFilter
double a0
Definition: biquad_filter.h:21
double b1
Definition: biquad_filter.h:25
double b2
Definition: biquad_filter.h:26
void BiquadFilter_SetupHighPass(BiquadFilter *filter, double ratio, double Q)
Definition: biquad_filter.c:36
double xn1
Definition: biquad_filter.h:16
double yn1
Definition: biquad_filter.h:18
double a2
Definition: biquad_filter.h:23
Definition: biquad_filter.h:14
void BiquadFilter_Filter(BiquadFilter *filter, float *inputs, float *outputs, int numSamples)
Definition: biquad_filter.c:81
double alpha
Definition: biquad_filter.h:30
double a1
Definition: biquad_filter.h:22
double cos_omega
Definition: biquad_filter.h:28
double xn2
Definition: biquad_filter.h:17
double yn2
Definition: biquad_filter.h:19
void BiquadFilter_SetupNotch(BiquadFilter *filter, double ratio, double Q)
Definition: biquad_filter.c:59