Trait idsp::Filter

source ·
pub trait Filter {
    type Config;

    // Required methods
    fn update(&mut self, x: i32, k: &Self::Config) -> i32;
    fn get(&self) -> i32;
    fn set(&mut self, x: i32);
}
Expand description

Single inpout single output i32 filter

Required Associated Types§

source

type Config

Filter configuration type.

While the filter struct owns the state, the configuration is decoupled to allow sharing.

Required Methods§

source

fn update(&mut self, x: i32, k: &Self::Config) -> i32

Update the filter with a new sample.

§Args
  • x: Input data.
  • k: Filter configuration.
§Return

Filtered output y.

source

fn get(&self) -> i32

Return the current filter output

source

fn set(&mut self, x: i32)

Update the filter so that it outputs the provided value. This does not completely define the state of the filter.

Implementors§

source§

impl Filter for Nyquist

source§

impl<T: Filter, U: Filter> Filter for Cascade<T, U>

source§

type Config = (<T as Filter>::Config, <U as Filter>::Config)

source§

impl<const N: usize> Filter for Lowpass<N>

source§

type Config = [i32; N]

source§

impl<const N: usize, T: Filter> Filter for Repeat<N, T>