Note: This page has been translated by MathWorks. Please click here

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Savitzky-Golay filtering

`y = sgolayfilt(x,order,framelen)`

y = sgolayfilt(x,order,framelen,weights)

y = sgolayfilt(x,order,framelen,weights,dim)

`y = sgolayfilt(x,order,framelen)`

applies
a Savitzky-Golay FIR smoothing filter to the data in vector `x`

.
If `x`

is a matrix, `sgolayfilt`

operates
on each column. The polynomial order, `order`

, must
be less than the frame length, `framelen`

, and in
turn `framelen`

must be odd. If `k`

= `framelen-1`

, the
filter produces no smoothing.

`y = sgolayfilt(x,order,framelen,weights)`

specifies
a weighting vector, `weights`

, with length `framelen`

,
which contains the real, positive-valued weights to be used during
the least-squares minimization. If `weights`

is not
specified, or if it is specified as empty, `[]`

,
it defaults to an identity matrix.

`y = sgolayfilt(x,order,framelen,weights,dim)`

specifies
the dimension, `dim`

, along which the filter operates.
If `dim`

is not specified, `sgolayfilt`

operates
along the first nonsingleton dimension; that is, dimension 1 for column
vectors and nontrivial matrices, and dimension 2 for row vectors.

[1] Orfanidis, Sophocles J. *Introduction
to Signal Processing*. Englewood Cliffs, NJ: Prentice-Hall,
1996.

Was this topic helpful?