# What are the advantages and disadvantages to the various smoothing functions available in LabChart?

There are four options available in Labchart's smoothing channel calculation. Listed below are the general calculation methods as well as the advantages and disadvantages of these four smoothing methods.

1. Triangular (Bartlett) window: Triangular Smoothing refers to using a triangular (Bartlett) weighting of the data points in the moving window which generates the smoothed values. With a triangular window the points in the middle of the window matter more, and the weighting decreases to zero going out towards the edges of the window. This reduces the effects of aliasing, and is often a good replacement for a traditional moving average (using a rectangular window where each point has equal weighting).Triangular smoothing is also faster to calculate than Savitzky–Golay smoothing, because computation time is independent of the window width. However Savitzky–Golay has the advantage that the amplitude of some high frequency components will be better preserved.
2. Savitzky-Golay: Fits a polynomial in a window of points around each sample point, using least squares fitting. You can choose the degree of the fitted polynomial, from two to six. Savitzky–Golay smoothing (as implemented in LabChart) has a computation time proportional to window width, but has the advantage of preserving the area, position and width of peaks, which may be useful for some forms of analysis. Also, where data peaks are defined by only a few points, the Savitzky–Golay method flattens peaks less than moving average (triangular Bartlett) smoothing with the same window width.
3. Median Filter: The median filter sorts the data values in the window around each sample point and returns the middle value. The median filter has a computation time of n log n, where n is the window width, but it effectively removes impulsive spikes from signals such as ECG recordings. It is recommended that a window width no larger than necessary is used.
4. Averaging (decimation): Averaging with decimation replaces all the data values in the window with a true ("boxcar") averaged value. This compresses the data and effectively results in a change to the sampling rate, so calculations on the results are faster (even for very large window widths.