ring buffer init

This commit is contained in:
2026-06-11 13:19:41 +02:00
parent f402885ab8
commit 819171720c
4 changed files with 73 additions and 0 deletions

32
src/fir.rs Normal file
View 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 () {
}
}