chunk to sample process
This commit is contained in:
@ -1,5 +1,3 @@
|
||||
use std::{os::unix::process, slice::Chunks};
|
||||
|
||||
use crate::iq_reader::{IqChunk, IqSample};
|
||||
|
||||
pub struct FmDemod<I> {
|
||||
@ -15,7 +13,7 @@ impl<I> FmDemod<I> {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn process_chunk(&mut self, chunk: &mut IqChunk) {
|
||||
pub fn process_sample(&mut self, sample: IqSample) -> IqSample {
|
||||
// TODO: FM Demodulation
|
||||
todo!();
|
||||
}
|
||||
@ -23,16 +21,13 @@ impl<I> FmDemod<I> {
|
||||
|
||||
impl<I, E> Iterator for FmDemod<I>
|
||||
where
|
||||
I: Iterator<Item = Result<IqChunk, E>>,
|
||||
I: Iterator<Item = Result<IqSample, E>>,
|
||||
{
|
||||
type Item = Result<IqChunk, E>;
|
||||
type Item = Result<IqSample, E>;
|
||||
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
match self.inner.next()? {
|
||||
Ok(mut chunk) => {
|
||||
self.process_chunk(&mut chunk);
|
||||
Some(Ok(chunk))
|
||||
}
|
||||
Ok(sample) => Some(Ok(self.process_sample(sample))),
|
||||
Err(e) => Some(Err(e)),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user