21 lines
668 B
Rust
21 lines
668 B
Rust
use crate::agc::Agc;
|
|
use crate::fir::Fir;
|
|
use crate::fm_demod::FmDemod;
|
|
use crate::iq_reader::IqSample;
|
|
|
|
pub trait DspPipelineExt<E>: Iterator<Item = Result<IqSample, E>> + Sized {
|
|
fn agc(self, sample_rate: f32, target_power: f32, min_gain: f32, max_gain: f32) -> Agc<Self> {
|
|
Agc::new(self, sample_rate, target_power, min_gain, max_gain)
|
|
}
|
|
|
|
fn fir<const N: usize>(self, taps: [f32; N], decimation_factor: usize) -> Fir<Self, N> {
|
|
Fir::new(self, taps, decimation_factor)
|
|
}
|
|
|
|
fn demodulate(self) -> FmDemod<Self> {
|
|
FmDemod::new(self)
|
|
}
|
|
}
|
|
|
|
impl<I, E> DspPipelineExt<E> for I where I: Iterator<Item = Result<IqSample, E>> {}
|