LowPassFilter2p: fix _cutoff_freq <= 0 (disabled filter)

If the filter was disabled, the apply() would always return 0.
This commit is contained in:
Beat Küng 2018-10-24 20:24:01 +02:00 committed by Lorenz Meier
parent d2e2b5e8ce
commit 294af5daad
2 changed files with 2 additions and 2 deletions

View File

@ -50,7 +50,7 @@ void LowPassFilter2p::set_cutoff_frequency(float sample_freq, float cutoff_freq)
if (_cutoff_freq <= 0.0f) {
// no filtering
_b0 = 0.0f;
_b0 = 1.0f;
_b1 = 0.0f;
_b2 = 0.0f;

View File

@ -50,7 +50,7 @@ void LowPassFilter2pVector3f::set_cutoff_frequency(float sample_freq, float cuto
if (_cutoff_freq <= 0.0f) {
// no filtering
_b0 = 0.0f;
_b0 = 1.0f;
_b1 = 0.0f;
_b2 = 0.0f;