From 8b41532e597b6bf6fc16fe17700fd0a91d15f129 Mon Sep 17 00:00:00 2001 From: Determinant Date: Thu, 4 Jan 2018 14:40:39 +0800 Subject: correct the IIR low pass filter; add rom test checklist --- src/apu.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/apu.rs') diff --git a/src/apu.rs b/src/apu.rs index 1a8a4fa..6b06b0b 100644 --- a/src/apu.rs +++ b/src/apu.rs @@ -26,8 +26,9 @@ impl LPFilter { } fn output(&mut self, input: i16) -> i16 { - let out = cutoff((input as i32 - self.prev_out as i32) - * LP_FACTOR / AUDIO_LEVEL_MAX); + let out = cutoff(self.prev_out as i32 + + (input as i32 - self.prev_out as i32) + * LP_FACTOR / AUDIO_LEVEL_MAX); self.prev_out = out; out } -- cgit v1.2.3-70-g09d2