adaptif 0.0.1

Adaptive filters for digital signal processing.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::types::buffers::NoiseWindowView;
use crate::types::{Float, WindowSize};

/// Trait used for implementing algorithms with block-based processing used in conjuction with
/// `FilterBase`.
pub trait Algorithm<F: Float> {
    /// Updates the weights for the next block based on the algorithm's update rules.
    /// This function is called for every processing block by the filter during adapation.
    /// `error` are the cleaned samples from the current block.
    /// `noise_ref` is the noise reference signal within the current processing window (the $k$ most recent samples).
    fn update_step(&mut self, weights: &mut [F], error: F, noise_window: NoiseWindowView<F>);

    /// Window size used by the algorithm.
    fn window_size(&self) -> WindowSize;
}