Savitzky-Golay filtering

`y = sgolayfilt(x,k,f)`

y = sgolayfilt(x,k,f,w)

y = sgolayfilt(x,k,f,w,dim)

`y = sgolayfilt(x,k,f)`

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 `k`

must be
less than the frame size, `f`

, which must be odd.
If `k`

= `f-1`

,
the filter produces no smoothing.

`y = sgolayfilt(x,k,f,w)`

specifies
a weighting vector `w`

with length `f`

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

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

, `w`

defaults
to an identity matrix.

`y = sgolayfilt(x,k,f,w,dim)`

specifies the dimension, `dim`

, along which the filter
operates. If `dim`

is not specified, `sgolayfilt`

operates
along the first non-singleton 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?