| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → System Identification Toolbox |
| Contents | Index |
| Learn more about System Identification Toolbox |
| On this page… |
|---|
Why Transform Between Continuous and Discrete Time? Using the c2d, d2c, and d2d Commands |
Transforming between continuous-time and discrete-time representations is useful, for example, if you have estimated a discrete-time linear model and require a continuous-time model instead.
d2d is useful is you want to change the sampling interval of a discrete model. All of these operations change the sampling interval, which is called resampling the model.
You can use c2d and d2c to transform any idmodel object between continuous-time and discrete-time representations.
The following table summarizes the commands for transforming between continuous-time and discrete-time model representations. These commands also transform the estimated model uncertainty, which corresponds to the estimated covariance matrix of the parameters. For detailed information about these commands, see the corresponding reference page.
Note c2d and d2d correctly approximate the transformation of the noise model when the sampling interval T is small compared to the bandwidth of the noise. |
| Command | Description | Usage Example |
|---|---|---|
| c2d | Converts continuous-time models to discrete-time models. | To transform a continuous-time model mod_c to a discrete-time form, use the following command: mod_d = c2d(mod_c,T) where T is the sampling interval of the discrete-time model. |
| d2c | Converts parametric discrete-time models to continuous-time models. | To transform a discrete-time model mod_d to
a continuous-time form, use the following command:mod_c = d2c(mod_d) |
| d2d | Resample a linear discrete-time model and produce an equivalent
discrete-time model with a new sampling interval. You can use the resampled model to simulate or predict output with a specified time interval. | To resample a discrete-time model mod_d1 to a discrete-time form with a new sampling interval Ts, use the following command: mod_d2 = d2d(mod_d1,Ts) |
The following commands compare estimated model m and its continuous-time counterpart mc on a Bode plot:
% Estimate discrete-time ARMAX model % from the data m = armax(data,[2 3 1 2]); % Convert to continuous-time form mc = d2c(m); % Plot bode plot for both models bode(m,mc)
A sampled signal is characterized only by its values at the sampling instants. However, when you apply a continuous-time input to a continuous-time system, the output values at the sampling instants depend on the inputs at the sampling instants and on the inputs between these points. Thus, the InterSample data property describes how the algorithms should handle the input between samples. For example, you can specify the behavior between the samples to be piece-wise constant (zero-order hold, zoh) or linearly interpolated between the samples (first order hold, foh). The transformation formulas for c2d and d2c are affected by the intersample behavior of the input.
By default, c2d and d2c use the intersample behavior you assigned to the estimation data. To override this setting during transformation, add an extra argument in the syntax. For example:
% Set first-order hold intersample behavior mod_d = c2d(mod_c,T,'foh')
The discrete-to-continuous-time conversion d2c properly handles any input delays in the discrete-time model, and stores this information in the continuous-time model. An input delay is the delay in the response of the output to the input signal.
The relationship between discrete-time and continuous-time delays depends on the input intersample behavior. For example, a continuous-time system without a delay shows a delay when sampled with a zero-order-hold input.
A delay in the discrete-time model that corresponds to an actual delay in the continuous-time model is stored in the in the InputDelay property of the resulting continuous-time model. Typically, this InputDelay is (nk-1)/Ts, where nk is the delay of the discrete-time system and Ts is the sampling interval.
Note Unlike for discrete-time models, the nk property of continuous-time model is only used to flag when immediate response to step changes is present; nk is not used to store input delays greater than or equal to 1. When nk(i)=0, then there is an immediate response to a step change in the input ith. When nk(i)=1, then there is no immediate response to the input. |
c2d, d2c, and d2d change the sampling interval of both the dynamic model and the noise model. Resampling a model affects the variance of its noise model.
A parametric noise model is a time-series model with the following mathematical description:
![]()
The noise spectrum is computed by the following discrete-time equation:
![]()
where
is the variance of the white
noise e(t), and
represents
the spectral density of e(t). Resampling the
noise model preserves the spectral density
T . The
spectral density
T is
invariant up to the Nyquist frequency. For more information about
spectrum normalization, see Spectrum Normalization.
d2d resampling of the noise model affects
simulations with noise using sim. If you resample
a model to a faster sampling rate, simulating this model results in
higher noise level. This higher noise level results from the underlying
continuous-time model being subject to continuous-time white noise
disturbances, which have infinite, instantaneous variance. In this
case, the underlying continuous-time model is
the unique representation for discrete-time models. To maintain the
same level of noise after interpolating the noise signal, scale the
noise spectrum by
, where Tnew is
the new sampling interval and Told is
the original sampling interval. before applying sim.
c2d and d2c transformations produce warnings when the continuous-time disturbance model does not have the required white-noise component. These warnings occur because the underlying state-space model, which is formed and used by these transformations, is ill-defined. In this case, modify the C-polynomial such that the degree of the monic C-polynomial in continuous-time equals the sum of the degrees of the monic A- and D-polynomials in continuous-time. For example:
length(C)-1 = (length(A)-1)+(length(D)-1)
![]() | Extracting Dynamic Model and Noise Model Separately | Transforming Between Linear Model Representations | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |