From 5165355abceb91291c15d4bfc5bb03df79a5ba16 Mon Sep 17 00:00:00 2001 From: Oleg Kalachev Date: Tue, 29 Apr 2025 23:28:56 +0300 Subject: [PATCH] Make low pass filter formula more straightforward --- flix/lpf.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flix/lpf.h b/flix/lpf.h index 56c231e..88cf8ab 100644 --- a/flix/lpf.h +++ b/flix/lpf.h @@ -22,7 +22,8 @@ public: output = input; initialized = true; } - return output = output * (1 - alpha) + input * alpha; + + return output += alpha * (input - output); } void setCutOffFrequency(float cutOffFreq, float dt) {