pub struct Window<T: FloatCore, const WINDOW_SIZE: usize> { /* private fields */ }
Expand description
Window of Hampel filter
WINDOW_SIZE
>= 3
Implementations§
source§impl<T: FloatCore, const WINDOW_SIZE: usize> Window<T, WINDOW_SIZE>
impl<T: FloatCore, const WINDOW_SIZE: usize> Window<T, WINDOW_SIZE>
sourcepub fn new(init_val: T, n_sigma: T) -> Self
pub fn new(init_val: T, n_sigma: T) -> Self
init_val
: Initialization value of window.n_sigma
: Threshold for determining an outlier.
If the window’s input value exceeds the window's standard deviation
* n_sigma
,
it is determined to be an outlier.
The larger n_sigma is, the harder it is to detect outliers.
sourcepub fn update(&mut self, x: T) -> T
pub fn update(&mut self, x: T) -> T
Update element in window.
When x
is determined to be an outlier, the median value of the window is usually returned.
If the extrapolation
feature is enabled, the linear extrapolated value is returned.
When x
is judged not to be an outlier, x
is returned as is.
Auto Trait Implementations§
impl<T, const WINDOW_SIZE: usize> Freeze for Window<T, WINDOW_SIZE>where
T: Freeze,
impl<T, const WINDOW_SIZE: usize> RefUnwindSafe for Window<T, WINDOW_SIZE>where
T: RefUnwindSafe,
impl<T, const WINDOW_SIZE: usize> Send for Window<T, WINDOW_SIZE>where
T: Send,
impl<T, const WINDOW_SIZE: usize> Sync for Window<T, WINDOW_SIZE>where
T: Sync,
impl<T, const WINDOW_SIZE: usize> Unpin for Window<T, WINDOW_SIZE>where
T: Unpin,
impl<T, const WINDOW_SIZE: usize> UnwindSafe for Window<T, WINDOW_SIZE>where
T: UnwindSafe,
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