Remove trends from output-input data.
Syntax
zd = dtrend(z)
zd = dtrend(z,o,brkp)
Description
z is a matrix, with data organized in column vectors. dtrend removes the trend from each column and returns the result in zd.
The default (o = 0) removes the zero-th order trends, i.e., the sample means are subtracted.
With o = 1, linear trends are removed, after a least-squares fit. With brkp not specified, one single line is subtracted from the entire data record. A continuous piecewise linear trend is subtracted if brkp contains breakpoints at sample numbers given in a row vector.
Note that dtrend differs somewhat from detrend in the Signal Processing Toolbox.
Examples
Remove a V-shaped trend from the output with its peak at sample number 119, and remove the sample mean from the input:
zd(:,1) = dtrend(z(:,1),1,119);
zd(:,2) = dtrend(z(:,2));
[ Previous | Help Desk | Next ]