.sits_signal_sgolayfilt {sits}R Documentation

Savitsky-Golay smoothing filter

Description

Smooth the data in x with a Savitsky-Golay smoothing filter of polynomial order p and length n, n odd, n > p. By default, p=3 and n=p+2 or n=p+3 if p is even. This filters is particularly good at preserving lineshape while removing high frequency squiggles

Computes the filter coefficients for all Savitzky-Golay smoothing filters of order p for length n (odd). m can be used in order to get directly the mth derivative. In this case, ts is a scaling factor.

The early rows of F smooth based on future values and later rows smooth based on past values, with the middle row using half future and half past. In particular, you can use row i to estimate x(k) based on the i-1 preceding values and the n-i following values of x values as y(k) = F(i,:) * x(k-i+1:k+n-i).

Usage

.sits_signal_sgolayfilt(x, p = 3, n = p + 3 - p%%2, m = 0, ts = 1)

.sits_signal_sgolay(p, n, m = 0, ts = 1)

Arguments

x

Time series vector.

p

Filter order (integer).

n

Filter length (must be odd)

m

Derivative to calculate (default = 0)

ts

Time scaling (integer).

Value

A time series with filtered values.

filter coefficients

Author(s)

Gilberto Camara

Gilberto Camara


[Package sits version 0.15.0 Index]