Functions > Signal Processing > Time Series Analysis > Linear Detrending
  
Linear Detrending
detrend(v)—Returns the array v with any linear trend removed.
Arguments
v is a real- or complex-valued data array whose length is greater than or equal to 3.
Additional Information
The function returns the corresponding vector of residuals of the same length as v. Pictorially, it causes sloped data to appear flatter.
The detrending process is useful in some spectral estimation methods that are sensitive to the presence of linear trends and can be unreliable for low frequencies if the trend is not removed.