pub struct FilterConfig {
pub num_filter: usize,
pub auto_reset: bool,
pub filter_callbacks: usize,
pub oc: [f64; 4],
pub fc: [f64; 4],
pub rc: [f64; 2],
pub o_offset: f64,
pub o_scale: f64,
pub f_offset: f64,
pub f_scale: f64,
}Expand description
4-tap recursive filter configuration.
Filter step: F_n = FC1I_n + FC2F_{n-1} + FC3*(F_{n-2} - FOffset) + FC4*(F_{n-3} - FOffset) F_n = FOffset + FScale * F_n
Output step: O_n = OC1F_n + OC2F_{n-1} + OC3*(O_{n-1} - OOffset) + OC4*(O_{n-2} - OOffset) O_n = OOffset + OScale * O_n
Reset (first frame or auto-reset): F_0 = RC1 * I + RC2 * F_prev (F_prev = 0 initially)
Fields§
§num_filter: usizeNumber of frames to average before auto-reset (if enabled).
auto_reset: boolAutomatically reset the filter when num_filtered reaches num_filter.
filter_callbacks: usizeOutput every N frames (0 = every frame).
oc: [f64; 4]Output coefficients [OC1, OC2, OC3, OC4].
fc: [f64; 4]Filter coefficients [FC1, FC2, FC3, FC4].
rc: [f64; 2]Reset coefficients [RC1, RC2].
o_offset: f64Output offset.
o_scale: f64Output scale.
f_offset: f64Filter offset.
f_scale: f64Filter scale.
Trait Implementations§
Source§impl Clone for FilterConfig
impl Clone for FilterConfig
Source§fn clone(&self) -> FilterConfig
fn clone(&self) -> FilterConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FilterConfig
impl Debug for FilterConfig
Auto Trait Implementations§
impl Freeze for FilterConfig
impl RefUnwindSafe for FilterConfig
impl Send for FilterConfig
impl Sync for FilterConfig
impl Unpin for FilterConfig
impl UnsafeUnpin for FilterConfig
impl UnwindSafe for FilterConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more