To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
The primary repository for this project is hosted at https://github.com/sonic-visualiser/sv-dependency-builds .
This repository is a read-only copy which is updated automatically every hour.
root / src / portaudio_20161030_catalina_patch / qa / loopback / src / biquad_filter.h @ 162:d43aab368df9
History | View | Annotate | Download (866 Bytes)
| 1 |
#ifndef _BIQUADFILTER_H
|
|---|---|
| 2 |
#define _BIQUADFILTER_H
|
| 3 |
|
| 4 |
|
| 5 |
/**
|
| 6 |
* Unit_BiquadFilter implements a second order IIR filter.
|
| 7 |
*
|
| 8 |
* @author (C) 2002 Phil Burk, SoftSynth.com, All Rights Reserved
|
| 9 |
*/
|
| 10 |
|
| 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
|