From 7c782dda88b6a97b5477371ebcc6af6541c1edb6 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 11 Jun 2022 20:36:01 +1000 Subject: [PATCH] Filter: fixed ordering of samples in notch reset --- libraries/Filter/NotchFilter.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/Filter/NotchFilter.cpp b/libraries/Filter/NotchFilter.cpp index 510f085094..1f3c374442 100644 --- a/libraries/Filter/NotchFilter.cpp +++ b/libraries/Filter/NotchFilter.cpp @@ -77,11 +77,11 @@ T NotchFilter::apply(const T &sample) if (!initialised || need_reset) { // if we have not been initialised when return the input // sample as output and update delayed samples - ntchsig2 = ntchsig1; - ntchsig1 = ntchsig; - ntchsig = sample; - signal2 = signal1; signal1 = sample; + signal2 = sample; + ntchsig = sample; + ntchsig1 = sample; + ntchsig2 = sample; need_reset = false; return sample; }