Smooth values using a Savitzky-Golay filter. This function is suitable for not equally-spaced and/or weighted data.

w_savgol(y, x, q, window = 7, polynom = 3)

Arguments

y

List of floats representing the "y" values.

x

List of floats representing the "x" values of the data. Must have same length as y. If missing, points are assumed to be equally-spaced

q

List of floats representing the relative weight of "y" values. Must have same length as y. If missing, all points are assumed to have the same weight.

window

Window length of datapoints. Must be odd and smaller than x. Default is 7.

polynom

The polynomial order to be used. Must be smaller than the window size. Default is 3.

Value

The smoothed "y" values.

Author

Luigi Ranghetti, PhD (2020) luigi@ranghetti.info