update biquad (#2201)
This commit is contained in:
parent
99430a2508
commit
d0c71d758b
|
@ -49,7 +49,6 @@ void Biquad::configureLowpass(float samplingFrequency, float cutoffFrequency, fl
|
|||
float K = getK(samplingFrequency, cutoffFrequency);
|
||||
float norm = getNorm(K, Q);
|
||||
|
||||
norm = 1 / (1 + K / Q + K * K);
|
||||
a0 = K * K * norm;
|
||||
a1 = 2 * a0;
|
||||
a2 = a0;
|
||||
|
|
|
@ -17,8 +17,9 @@ public:
|
|||
|
||||
void configureBandpass(float samplingFrequency, float centerFrequency, float Q);
|
||||
|
||||
// Default Q = 1/sqrt(2) = 0.707 gives a maximally flat passband without any overshoot near the cutoff (ie, Butterworth)
|
||||
void configureLowpass(float samplingFrequency, float cutoffFrequency, float Q = 0.707f);
|
||||
// Default Q = 0.54, which is the maximum quality factor without time domain overshoot
|
||||
// note that it is less than the maximally flat (frequency domain) Q=0.707, which gives some overshoot
|
||||
void configureLowpass(float samplingFrequency, float cutoffFrequency, float Q = 0.54f);
|
||||
|
||||
private:
|
||||
float a0, a1, a2, b1, b2;
|
||||
|
|
Loading…
Reference in New Issue