ring buffer init
This commit is contained in:
32
src/fir.rs
Normal file
32
src/fir.rs
Normal file
@ -0,0 +1,32 @@
|
||||
// Finite Impulse response + Decimation
|
||||
use num_complex::Complex32;
|
||||
use crate::utils::ring_buffer::RingBuffer;
|
||||
|
||||
pub struct Fir {
|
||||
// Filter coefs
|
||||
pub taps: Vec<f32>,
|
||||
|
||||
// Ring Buffer of samples
|
||||
pub history: RingBuffer<Complex32>,
|
||||
|
||||
decimation_factor: usize,
|
||||
|
||||
// When to keep a sample
|
||||
decimator_counter: usize,
|
||||
}
|
||||
|
||||
impl Fir {
|
||||
fn new(decimation_factor: usize) -> Self {
|
||||
Self {
|
||||
// TODO: precalulate filter coefs + ring buffer
|
||||
taps: vec![],
|
||||
history:
|
||||
decimation_factor,
|
||||
decimator_counter: 0,
|
||||
}
|
||||
}
|
||||
|
||||
fn () {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user