fm demod
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
use crate::iq_reader::IqSample;
|
||||
|
||||
pub type Phase = f32;
|
||||
pub type Sample = f32;
|
||||
|
||||
pub struct FmDemod<I> {
|
||||
pub inner: I,
|
||||
@ -15,7 +15,7 @@ impl<I> FmDemod<I> {
|
||||
}
|
||||
}
|
||||
|
||||
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<I, E> Iterator for FmDemod<I>
|
||||
where
|
||||
I: Iterator<Item = Result<IqSample, E>>,
|
||||
{
|
||||
type Item = Result<Phase, E>;
|
||||
type Item = Result<Sample, E>;
|
||||
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
match self.inner.next()? {
|
||||
|
||||
Reference in New Issue
Block a user