SavitzkyGolayFilter

ID: legacy/2020.x/SavitzkyGolayFilter


Deprecated: Replaced by array-based NumPy trace step template.

A Savitzky-Golay filter is a smoothing filter that can be applied to a set of signal points for the purpose of obtaining a smoothed version of the signal (DerivativeOrder = 0) or smoothed derivatives (of the order DerivativeOrder).

Note: Compared to a moving average process, in which the filtered signal is distorted by artificial damping and shifting, a Savitzky-Golay-Filter can yield more satisfactory results. The mathematical basis of this filter is a linear least squares fit of a polynomial (of degree Order) to the signal values over NumberOfPointsLeft + 1 + NumberOfPointsRight time stamps, that are assumed to be equidistant.

Signals

FilteredSignal

Filtered output signal.

  • Direction: OUT

  • Optional: False

Signal

Input signal.

  • Direction: IN

  • Optional: False

Parameters

DerivativeOrder

Use DerivativeOrder = 0 for smoothing of the signal, DerivativeOrder = 1 to obtain a smoothed first derivative and so on.

  • Direction: IN

  • Type: INTEGER

NumberOfPointsLeft

The polynomial is determined by the central point and NumberOfPointsLeft to the left and NumberOfPointsRight to the right.

  • Direction: IN

  • Type: INTEGER

NumberOfPointsRight

Set to zero if the filter needs to be causal.

  • Direction: IN

  • Type: INTEGER

Order

Degree of the polynomial used for linear least squares. For the calculation of derivatives a common choice is Order = 4 or larger.

  • Direction: IN

  • Type: INTEGER

SuppressStepsizeError

Equidistant time stamps are assumed. An Error is caused, if this assumption is violated severely. Set to True to suppress this error (None = False).

  • Direction: IN

  • Type: BOOLEAN