diff --git a/dsp/src/lockin.rs b/dsp/src/lockin.rs index b2f38c1..6ebf4cb 100644 --- a/dsp/src/lockin.rs +++ b/dsp/src/lockin.rs @@ -7,14 +7,6 @@ pub struct Lockin { } impl Lockin { - /// Create a new Lockin with given IIR coefficients. - pub fn new() -> Self { - let lp = Lowpass::default(); - Self { - state: [lp.clone(), lp], - } - } - /// Update the lockin with a sample taken at a given phase. /// The lowpass has a gain of `1 << k`. pub fn update(&mut self, sample: i16, phase: i32, k: u8) -> Complex { diff --git a/src/bin/lockin-external.rs b/src/bin/lockin-external.rs index c0e6cae..9b29033 100644 --- a/src/bin/lockin-external.rs +++ b/src/bin/lockin-external.rs @@ -34,8 +34,6 @@ const APP: () = { + design_parameters::SAMPLE_BUFFER_SIZE_LOG2, ); - let lockin = Lockin::new(); - // Enable ADC/DAC events stabilizer.adcs.0.start(); stabilizer.adcs.1.start(); @@ -59,7 +57,7 @@ const APP: () = { timestamper: stabilizer.timestamper, pll, - lockin, + lockin: Lockin::default(), } } diff --git a/src/bin/lockin-internal.rs b/src/bin/lockin-internal.rs index cfa3115..c4d5bd6 100644 --- a/src/bin/lockin-internal.rs +++ b/src/bin/lockin-internal.rs @@ -28,8 +28,6 @@ const APP: () = { // Configure the microcontroller let (mut stabilizer, _pounder) = hardware::setup(c.core, c.device); - let lockin = Lockin::new(); - // Enable ADC/DAC events stabilizer.adcs.1.start(); stabilizer.dacs.0.start(); @@ -39,7 +37,7 @@ const APP: () = { stabilizer.adc_dac_timer.start(); init::LateResources { - lockin, + lockin: Lockin::default(), afes: stabilizer.afes, adc: stabilizer.adcs.1, dacs: stabilizer.dacs,