Savitzky-Golay Algorithm¶
Local Algorithm - One-Dimensional Algorithm
Savitzky-Golay algorithm performs a local polynomial regression on a given sequence of values. The basic formula (for filter width L=2M+1 and polynomial order k) is stated as follows:
ˆY[n]=12M+1M∑k=−MA[k]Y[n−k],
where Y[n] and ˆY[n] denote the raw and processed data sequences, respectively. The values of A[k], the Savitzky-Golay coefficient vector, depends on the choice of polynomial order k. Note that the Savitzky-Golay coefficient vector can be pre-computed based on the idea to make for each point a local least-square polynomial fit.
Input Parameters
Parameter | Type | Constraint | Description | Remarks |
---|---|---|---|---|
Y[n] | Y[n]∈RN | N∈N | Input data sequence of length N | The algorithm assumes that input values contain no outliers and improper values such as ‘nan’, ‘inf’, ‘null’. |
L | L∈N | L=2M+1,M∈N | ||
k | k∈N |
Output Parameters
Parameter | Type | Constraint | Description | Remarks |
---|---|---|---|---|
ˆY[n] | ˆY[n]∈RN | N∈N | Output data sequence of length N |
Tool Support
-
For details refer to the online documentation of the function ‘sgolayfilt’.
Single Steps using the Algorithm
References
- A. Savitzky, M.J.E. Golay, Smoothing and Differentiation of Data by Simplified Least Squares Procedures, Analytical Chemistry, vol. 36, Issue 8, pp 1627-1639, 1964.
- S.J. Orfanidis, Introduction to Signal Processing, Prentice-Hall, Englewood Cliffs, NJ, 1996.