Struct cic_fixed::CicDecimationFilter
source · pub struct CicDecimationFilter<const M: usize, const N: usize> { /* private fields */ }Expand description
CIC decimation filter.
M- Decimation factorN- Number of stages
Implementations§
source§impl<const M: usize, const N: usize> CicDecimationFilter<M, N>
impl<const M: usize, const N: usize> CicDecimationFilter<M, N>
pub const fn new() -> Self
sourcepub fn filter(&mut self, input: i32) -> Option<i32>
pub fn filter(&mut self, input: i32) -> Option<i32>
Process the input and return the output when the decimator is ready to output a value.
Arguments
input- The input to filter.
Returns
The output of the filter.
The output range is Input range * (M^N). For example, if Input range is +/-1, M is 4, and N is 2, the output range is +/-16.
When the decimator is ready to output a value, it will return some(input). Otherwise, it will return None.
Trait Implementations§
Auto Trait Implementations§
impl<const M: usize, const N: usize> RefUnwindSafe for CicDecimationFilter<M, N>
impl<const M: usize, const N: usize> Send for CicDecimationFilter<M, N>
impl<const M: usize, const N: usize> Sync for CicDecimationFilter<M, N>
impl<const M: usize, const N: usize> Unpin for CicDecimationFilter<M, N>
impl<const M: usize, const N: usize> UnwindSafe for CicDecimationFilter<M, N>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more