From 8d68504026f33f6fb18481f7487489a541741a43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20J=C3=B6rdens?= Date: Wed, 10 Feb 2021 13:31:41 +0100 Subject: [PATCH] lowpass: symmetric code --- dsp/src/lowpass.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dsp/src/lowpass.rs b/dsp/src/lowpass.rs index b85e2ed..24832a8 100644 --- a/dsp/src/lowpass.rs +++ b/dsp/src/lowpass.rs @@ -25,7 +25,7 @@ impl> Lowpass { // Note the zero(s) at Nyquist and the benign overflow (DF-I). let mut x0 = x; let mut x1 = self.xy[0]; - self.xy[0] = x; + self.xy[0] = x0; for y1 in self.xy[1..].iter_mut() { x0 = *y1 + (((x0 >> 1) + (x1 >> 1) - *y1 + (1 << (k - 1))) >> k); x1 = *y1;