Applies spectral smoothing. Methods: "savgol" (Savitzky-Golay, needs
the signal package; otherwise falls back to moving average with a
warning), "moving_avg", "gaussian", "median".
Arguments
- x
A
ls_spectrum()orls_dataset()object.- method
Character. Default
"savgol".- window
Integer. Window size in channels (odd preferred). Default 11.
- poly_order
Integer. Polynomial order for Savitzky-Golay. Default 3.
Examples
spec <- ls_simulate_spectrum(seed = 1)
sm <- ls_smooth(spec, method = "moving_avg", window = 9)