General approach

Assumptions

All smoothing algorithms assume that the data is equidistant data. Non-equidistant data is transformed into equidistant data by applying a spline interpolation and resampling the data using the smallest time difference in the non-equidistant data.

Smoothing - base algorithm

All smoothing algorithms apply a window of size 2m+1 populated with smoothing coefficients, using the following approach:

where

a

Array of smoothing coefficients

x'

Smoothed signal

m

Even number specifying the half width of the smoothing window

This approach leads to an odd number 2m+1 for the total window size.

Handling the edges

Since the smoothing coefficients are supposed to be normalized, the edges need special consideration.

For Moving average and Gaussian filtering, the window is pruned at the left or right edge, and the coefficients are recomputed to have a total sum of 1 (normalization).

For Savitzy-Golay the handling is more complicated. It needs to preserve the properties of Savitzky-Golay filtering also close to the edges of the signal. See Algorithm details.