detrend {sysid}R Documentation

Remove offsets and linear trends

Description

Removes offsets or trends from data

Usage

detrend(x, type = 0)

Arguments

x

an object of class idframe

type

argument indicating the type of trend to be removed (Default=0)

  • type=0: Subtracts mean value from each signal

  • type=1: Subtracts a linear trend (least-squres fit)

  • type=trInfo object: Subtracts a trend specified by the object

Details

R by default doesn't allow return of multiple objects. The %=% operator and g function in this package facillitate this behaviour. See the examples section for more information.

Value

A list containing two objects: the detrended data and the trend information

See Also

lm

Examples

data(cstr)
datatrain <- dataSlice(cstr,end=4500)
datatest <- dataSlice(cstr,4501)
g(Ztrain,tr) %=% detrend(datatrain) # Remove means
g(Ztest) %=% detrend(datatest,tr)


[Package sysid version 1.0.4 Index]