Sliding-window mean after trimming alpha fraction of values from
each tail of the sorted window. Robust to both Gaussian and impulsive
noise; reduces to the mean filter when alpha = 0 and to the median
filter as alpha -> 0.5.
Usage
morie_dsp_alpha_trimmed_mean(x, window = 5L, alpha = 0.2)
Arguments
- x
Numeric vector.
- window
Window length. Default 5.
- alpha
Trim fraction (0 <= alpha < 0.5). Default 0.2.
Value
Filtered vector, length(x).
References
Rangayyan & Krishnan (2015), Ch. 3, sec. 3.4.