Skip to main content

savitzky_golay_coefficients

Function savitzky_golay_coefficients 

Source
pub fn savitzky_golay_coefficients(
    window: usize,
    order: usize,
    deriv: usize,
    delta: f64,
) -> Result<Vec<f64>, ErrorsJSL>
Expand description

Convolution coefficients of a Savitzky-Golay filter.

window must be odd and greater than order. deriv selects the derivative (0 = smoothing) and delta is the sample spacing (needed for deriv > 0). The coefficients are ordered for correlation with the data centred on the middle tap (i.e. y_smooth[i] = Σ c[k] y[i - m + k] with m = window / 2).