mirror of https://github.com/rusefi/rusefi-1.git
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 K = getK(samplingFrequency, cutoffFrequency);
|
||||||
float norm = getNorm(K, Q);
|
float norm = getNorm(K, Q);
|
||||||
|
|
||||||
norm = 1 / (1 + K / Q + K * K);
|
|
||||||
a0 = K * K * norm;
|
a0 = K * K * norm;
|
||||||
a1 = 2 * a0;
|
a1 = 2 * a0;
|
||||||
a2 = a0;
|
a2 = a0;
|
||||||
|
|
|
@ -17,8 +17,9 @@ public:
|
||||||
|
|
||||||
void configureBandpass(float samplingFrequency, float centerFrequency, float Q);
|
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)
|
// Default Q = 0.54, which is the maximum quality factor without time domain overshoot
|
||||||
void configureLowpass(float samplingFrequency, float cutoffFrequency, float Q = 0.707f);
|
// 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:
|
private:
|
||||||
float a0, a1, a2, b1, b2;
|
float a0, a1, a2, b1, b2;
|
||||||
|
|
Loading…
Reference in New Issue