Version:

Last Modified: June 25, 2019

Designs a Savitzky-Golay FIR smoothing filter, returning the designed Savitzky-Golay filter coefficients and the differentiation filter coefficients.

The number of data points to each side of the current data point to use for the least-squares minimization.

**side points**
* 2 + 1 is the length of the moving window, which must be greater than the
**polynomial order**.

**Default:
**6

Order of the polynomial.

**Default:
**3

Weighting vector to use in the least squares minimization.

This array must be empty or have a length of
**side points***2 + 1.

Error conditions that occur before this node runs.

The node responds to this input according to standard error behavior.

Standard Error Behavior

Many nodes provide an
**error in**
input and an
**error out**
output so that the node can respond to and communicate errors that occur while code is running. The value of
**error in**
specifies whether an error occurred before the node runs. Most nodes respond to values of
**error in**
in a standard, predictable way.

**Default:
**No error

A matrix with rows representing the FIR filter coefficients.

The matrix is
*n*-by-*n*, where
*n*
is
**side points***2+1.

A matrix where the
*p*-th row is the differentiation filter for the
*p*-th order derivative.

The matrix is
*m*-by-*n*, where
*m*
is
**polynomial order**+1, and
*n*
is
**side points***2+1.

This node computes
**differentiation filters**
only if
**compute differentiation filters?**
is True.

Error information.

The node produces this output according to standard error behavior.

Standard Error Behavior

**error in**
input and an
**error out**
output so that the node can respond to and communicate errors that occur while code is running. The value of
**error in**
specifies whether an error occurred before the node runs. Most nodes respond to values of
**error in**
in a standard, predictable way.

The Savitzky-Golay filter smoothes a noisy signal by the piece-by-piece fitting of a polynomial function to the signal. This node performs the fitting by least squares minimization. The length of the moving polynomial fitting window is 2*k*+1, where
*k*
is
**side points**.

The central row of
**Savitzky-Golay filters**
estimates the middle point of the moving window. The other rows of
**Savitzky-Golay filters**
smooth the endpoints of the signal, where the window length exceeds the number of remaining data points.

To smooth a signal, apply the first
*k*
rows of
**Savitzky-Golay filters**
to the first 2*k*+1 points of the signal to get the first*
k*
smoothed points. Apply the last*
k*
rows of
**Savitzky-Golay filters**
to the last 2*k*+1 points of the signal to get the last
*k*
smoothed points. Apply the central row of
**Savitzky-Golay filters**
for all other points.

**Where This Node Can Run:
**

Desktop OS: Windows

FPGA: Not supported

Web Server: Not supported in VIs that run in a web application