Applies Savytzky-Golay filter to the rows of data matrix
prep.savgol(data, width = 3, porder = 1, dorder = 0)
a matrix with data values
width of the filter window
order of polynomial used for smoothing
order of derivative to take (0 - no derivative)
The function implements algorithm described in [1] which handles the edge points correctly and does not require to cut the spectra.
1. Peter A. Gorry. General least-squares smoothing and differentiation by the convolution (Savitzky-Golay) method. Anal. Chem. 1990, 62, 6, 570–573, https://doi.org/10.1021/ac00205a007.