zero cost abstraction
This commit is contained in:
15
src/pipeline.rs
Normal file
15
src/pipeline.rs
Normal file
@ -0,0 +1,15 @@
|
||||
use crate::agc::Agc;
|
||||
use crate::fir::Fir;
|
||||
use crate::iq_reader::IqChunk;
|
||||
|
||||
pub trait DspPipelineExt<E>: Iterator<Item = Result<IqChunk, 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)
|
||||
}
|
||||
}
|
||||
|
||||
impl<I, E> DspPipelineExt<E> for I where I: Iterator<Item = Result<IqChunk, E>> {}
|
||||
Reference in New Issue
Block a user