| Contents | Index |
| On this page… |
|---|
Alternatives for Detrending Data in GUI or at the Command-Line |
Detrending is removing means, offsets, or linear trends from regularly sampled time-domain input-output data signals. This data processing operation helps you estimate more accurate linear models because linear models cannot capture arbitrary differences between the input and output signal levels. The linear models you estimate from detrended data describe the relationship between the change in input signals and the change in output signals.
For steady-state data, you should remove mean values and linear trends from both input and output signals.
For transient data, you should remove physical-equilibrium offsets measured prior to the excitation input signal.
Remove one linear trend or several piecewise linear trends when the levels drift during the experiment. Signal drift is considered a low-frequency disturbance and can result in unstable models.
You should not detrend data before model estimation when you want:
Linear models that capture offsets essential for describing important system dynamics. For example, when a model contains integration behavior, you could estimate a low-order transfer function (process model) from nondetrended data. For more information, see Identifying Low-Order Transfer Functions (Process Models).
Nonlinear black-box models, such as nonlinear ARX or Hammerstein-Wiener models. For more information, see Nonlinear Black-Box Model Identification.
Nonlinear ODE parameters (nonlinear grey-box models). For more information, see Estimating Nonlinear Grey-Box Models.
To simulate or predict the linear model response at the system operating conditions, you can restore the removed trend to the simulated or predicted model output using the retrend command.
For more information about handling drifts in the data, see the chapter on preprocessing data in System Identification: Theory for the User, Second Edition, by Lennart Ljung, Prentice Hall PTR, 1999.
You can detrend data using the System Identification Tool GUI and at the command line using the detrend command.
Both the GUI and the command line let you subtract the mean values and one linear trend from steady-state time-domain signals.
However, the detrend command provides the following additional functionality (not available in the GUI):
Subtracting piecewise linear trends at specified breakpoints. A breakpoint is a time value that defines the discontinuities between successive linear trends.
Subtracting arbitrary offsets and linear trends from transient data signals.
Saving trend information to a variable so that you can apply it to multiple data sets.
To learn how to detrend data, see:
After detrending your data, you might do the following:
Perform other data preprocessing operations. See Ways to Prepare Data for System Identification.
Estimate a linear model. See Linear Model Identification.
![]() | Handling Missing Data and Outliers | How to Detrend Data Using the GUI | ![]() |

Learn more about resources for designing, testing, and implementing control systems.
Get free kit| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |