From 38dfd48c149efaabce5dfa390b7bb6724b187dde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20J=C3=B6rdens?= Date: Wed, 25 Nov 2020 17:53:13 +0100 Subject: [PATCH] iir: fix comment [nfc] --- dsp/src/iir.rs | 2 +- src/main.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dsp/src/iir.rs b/dsp/src/iir.rs index 8d25c27..f58fb64 100644 --- a/dsp/src/iir.rs +++ b/dsp/src/iir.rs @@ -163,7 +163,7 @@ impl IIR { debug_assert!(xy.len() == n); // `xy` contains x0 x1 y0 y1 y2 // Increment time x1 x2 y1 y2 y3 - // Rotate y3 x1 x2 y1 y2 + // Shift x1 x1 x2 y1 y2 xy.copy_within(0..n - 1, 1); // unrolls better than xy.rotate_right(1) // Store x0 x0 x1 x2 y1 y2 xy[0] = x0; diff --git a/src/main.rs b/src/main.rs index ac9f1a6..3173158 100644 --- a/src/main.rs +++ b/src/main.rs @@ -758,10 +758,10 @@ const APP: () = { let x0 = f32::from(*adc0 as i16); let y0 = c.resources.iir_ch[0] .update(&mut c.resources.iir_state[0], x0); - // note(unsafe): The filter limits ensure that the value is in range. + // Note(unsafe): The filter limits ensure that the value is in range. // The truncation introduces 1/2 LSB distortion. let y0 = unsafe { y0.to_int_unchecked::() }; - // convert to DAC code + // Convert to DAC code y0 as u16 ^ 0x8000 }; @@ -769,10 +769,10 @@ const APP: () = { let x1 = f32::from(*adc1 as i16); let y1 = c.resources.iir_ch[1] .update(&mut c.resources.iir_state[1], x1); - // note(unsafe): The filter limits ensure that the value is in range. + // Note(unsafe): The filter limits ensure that the value is in range. // The truncation introduces 1/2 LSB distortion. let y1 = unsafe { y1.to_int_unchecked::() }; - // convert to DAC code + // Convert to DAC code y1 as u16 ^ 0x8000 }; }