User`s guide
Detrend
5-128
5Detrend
Purpose Remove a linear trend from a vector.
Library Statistics
Description The Detrend block removes a linear trend from the length-M input vector, u,
by subtracting the straight line that best fits the data in the least-squares
sense.
The least-squares line, û = ax + b, is the line with parameters a and b that
minimizes the quantity
for M evenly-spaced values of x, where u
i
is the ith element in the input vector.
The output, y = u–û, is an M-by-1 column vector (regardless of the input vector
dimension) with the same frame status as the input.
Dialog Box
Supported
Data Types
See Also
u
i
u
ˆ
i
–()
2
i 1=
M
∑
Double-precision floating point
Cumulative Sum DSP Blockset
Difference DSP Blockset
Least Squares Polynomial Fit DSP Blockset
Unwrap DSP Blockset
detrend
MATLAB