From e1c7ba7865cc73477e4c3d16b5d3baf4179f2d6e Mon Sep 17 00:00:00 2001 From: zeefaad Date: Mon, 15 Jun 2026 13:16:40 +0200 Subject: [PATCH] fm demod --- src/agc.rs | 2 +- src/fm_demod.rs | 6 +++--- src/main.rs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/agc.rs b/src/agc.rs index fb9debb..7418873 100644 --- a/src/agc.rs +++ b/src/agc.rs @@ -94,7 +94,7 @@ where fn next(&mut self) -> Option { match self.inner.next()? { - Ok(mut sample) => Some(Ok(self.process_sample(sample))), + Ok(sample) => Some(Ok(self.process_sample(sample))), Err(e) => Some(Err(e)), } } diff --git a/src/fm_demod.rs b/src/fm_demod.rs index 1441f43..84f8af5 100644 --- a/src/fm_demod.rs +++ b/src/fm_demod.rs @@ -1,6 +1,6 @@ use crate::iq_reader::IqSample; -pub type Phase = f32; +pub type Sample = f32; pub struct FmDemod { pub inner: I, @@ -15,7 +15,7 @@ impl FmDemod { } } - pub fn process_sample(&mut self, sample: IqSample) -> Phase { + pub fn process_sample(&mut self, sample: IqSample) -> Sample { let phase_diff = sample * self.prev_sample.conj(); self.prev_sample = sample; phase_diff.arg() @@ -26,7 +26,7 @@ impl Iterator for FmDemod where I: Iterator>, { - type Item = Result; + type Item = Result; fn next(&mut self) -> Option { match self.inner.next()? { diff --git a/src/main.rs b/src/main.rs index ca4972d..01b140f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -22,7 +22,7 @@ fn main() -> Result<(), Box> { for phase_r in pipeline { let phase = phase_r?; - println!("phase : {}", phase); + // println!("phase : {}", phase); } Ok(())