Continuous-Discrete Conversion Methods - MATLAB & Simulink (2024)

Continuous-Discrete Conversion Methods

Control System Toolbox™ offers several discretization and interpolation methods for converting dynamic system models between continuous time and discrete time and for resampling discrete-time models. Some methods tend to provide a better frequency-domain match between the original and converted systems, while others provide a better match in the time domain. Use the following table to help select the method that is best for your application.

Discretization MethodUse When
Zero-Order HoldYou want an exact discretization in the time domain for staircase inputs.
First-Order Hold You want an exact discretization in the time domain for piecewise linear inputs.
Impulse-Invariant Mapping (continuous-to-discrete conversion only)

You want an exact discretization in the time domain for impulse train inputs.

Tustin Approximation
  • You want good matching in the frequency domain between the continuous- and discrete-time models.

  • Your model has important dynamics at some particular frequency.

Zero-Pole Matching Equivalents
  • You have a SISO model.

  • You want good matching in the frequency domain between the continuous- and discrete-time models.

Least Squares (continuous-to-discrete conversion only)
  • You have a SISO model.

  • You want good matching in the frequency domain between the continuous- and discrete-time models.

  • You want to capture fast system dynamics but must use a larger sample time.

For information about how to specify a conversion method at the command line, see c2d, d2c, and d2d. You can experiment interactively with different discretization methods in the Live Editor using the Convert Model Rate task.

Zero-Order Hold

The Zero-Order Hold (ZOH) method provides an exact match between the continuous- and discrete-time systems in the time domain for staircase inputs.

The following block diagram illustrates the zero-order-hold discretization Hd(z) of a continuous-time linear model H(s).

Continuous-Discrete Conversion Methods- MATLAB & Simulink (1)

The ZOH block generates the continuous-time input signal u(t) by holding each sample value u(k) constant over one sample period:

u(t)=u[k],kTst(k+1)Ts

The signal u(t) is the input to the continuous system H(s). The output y[k] results from sampling y(t) every Ts seconds.

Conversely, given a discrete system Hd(z), d2c produces a continuous system H(s). The ZOH discretization of H(s) coincides with Hd(z).

The ZOH discrete-to-continuous conversion has the following limitations:

  • d2c cannot convert LTI models with poles at z = 0.

  • For discrete-time LTI models having negative real poles, ZOH d2c conversion produces a continuous system with higher order. The model order increases because a negative real pole in the z domain maps to a pure imaginary value in the s domain. Such mapping results in a continuous-time model with complex data. To avoid this issue, the software instead introduces a conjugate pair of complex poles in the s domain. See Convert Discrete-Time System to Continuous Time for an example.

ZOH Method for Systems with Time Delays

You can use the ZOH method to discretize SISO or MIMO continuous-time models with time delays. The ZOH method yields an exact discretization for systems with input delays, output delays, or transport delays.

For systems with internal delays (delays in feedback loops), the ZOH method results in approximate discretizations. The following figure illustrates a system with an internal delay.

Continuous-Discrete Conversion Methods- MATLAB & Simulink (2)

For such systems, c2d performs the following actions to compute an approximate ZOH discretization:

  1. Decomposes the delay τ as τ=kTs+ρ with 0ρ<Ts.

  2. Absorbs the fractional delay ρ into H(s).

  3. Discretizes H(s) to H(z).

  4. Represents the integer portion of the delay kTs as an internal discrete-time delay zk. The final discretized model appears in the following figure:

Continuous-Discrete Conversion Methods- MATLAB & Simulink (3)

First-Order Hold

The First-Order Hold (FOH) method provides an exact match between the continuous- and discrete-time systems in the time domain for piecewise linear inputs.

FOH differs from ZOH by the underlying hold mechanism. To turn the input samples u[k] into a continuous input u(t), FOH uses linear interpolation between samples:

In general, this method is more accurate than ZOH for systems driven by smooth inputs.

This FOH method differs from standard causal FOH and is more appropriately called triangle approximation (see [2], p. 228). The method is also known as ramp-invariant approximation.

FOH Method for Systems with Time Delays

You can use the FOH method to discretize SISO or MIMO continuous-time models with time delays. The FOH method handles time delays in the same way as the ZOH method. See ZOH Method for Systems with Time Delays.

Impulse-Invariant Mapping

The impulse-invariant mapping produces a discrete-time model with the same impulse response as the continuous time system. For example, compare the impulse response of a first-order continuous system with the impulse-invariant discretization:

G = tf(1,[1,1]);Gd1 = c2d(G,0.01,'impulse');impulse(G,Gd1)

Continuous-Discrete Conversion Methods- MATLAB & Simulink (4)

The impulse response plot shows that the impulse responses of the continuous and discretized systems match.

Impulse-Invariant Mapping for Systems with Time Delays

You can use impulse-invariant mapping to discretize SISO or MIMO continuous-time models with time delays, except that the method does not support ss models with internal delays. For supported models, impulse-invariant mapping yields an exact discretization of the time delay.

Tustin Approximation

The Tustin or bilinear approximation yields the best frequency-domain match between the continuous-time and discretized systems. This method relates the s-domain and z-domain transfer functions using the approximation:

z=esTs1+sTs/21sTs/2.

In c2d conversions, the discretization Hd(z) of a continuous transfer function H(s) is:

Hd(z)=H(s),s=2Tsz1z+1

Similarly, the d2c conversion relies on the inverse correspondence

H(s)=Hd(z),z=1+sTs/21sTs/2

When you convert a state-space model using the Tustin method, the states are not preserved. The state transformation depends upon the state-space matrices and whether the system has time delays. For example, for an explicit (E = I) continuous-time model with no time delays, the state vector w[k] of the discretized model is related to the continuous-time state vector x(t) by:

w[kTs]=(IATs2)x(kTs)Ts2Bu(kTs)=x(kTs)Ts2(Ax(kTs)+Bu(kTs)).

Ts is the sample time of the discrete-time model. A and B are state-space matrices of the continuous-time model.

The Tustin approximation is not defined for systems with poles at z = –1 and is ill-conditioned for systems with poles near z = –1.

Tustin Approximation with Frequency Prewarping

If your system has important dynamics at a particular frequency that you want the transformation to preserve, you can use the Tustin method with frequency prewarping. This method ensures a match between the continuous- and discrete-time responses at the prewarp frequency.

The Tustin approximation with frequency prewarping uses the following transformation of variables:

Hd(z)=H(s),s=ωtan(ωTs/2)z1z+1

This change of variable ensures the matching of the continuous- and discrete-time frequency responses at the prewarp frequency ω, because of the following correspondence:

H(jω)=Hd(ejωTs)

Tustin Approximation for Systems with Time Delays

You can use the Tustin approximation to discretize SISO or MIMO continuous-time models with time delays.

By default, the Tustin method rounds any time delay to the nearest multiple of the sample time. Therefore, for any time delay tau, the integer portion of the delay, k*Ts, maps to a delay of k sampling periods in the discretized model. This approach ignores the residual fractional delay, tau - k*Ts.

You can approximate the fractional portion of the delay by a discrete all-pass filter (Thiran filter) of specified order. To do so, use the ThiranOrder option of c2dOptions. See Improve Accuracy of Discretized System with Time Delay for an example.

To understand how the Tustin method handles systems with time delays, consider the following SISO state-space model G(s). The model has input delay τi, output delay τo, and internal delay τ.

Continuous-Discrete Conversion Methods- MATLAB & Simulink (5)

The following figure shows the general result of discretizing G(s) using the Tustin method.

Continuous-Discrete Conversion Methods- MATLAB & Simulink (6)

By default, c2d converts the time delays to pure integer time delays. The c2d command computes the integer delays by rounding each time delay to the nearest multiple of the sample time Ts. Thus, in the default case, mi = round(τi/Ts), mo = round(τo/Ts), and m = round(τ/Ts).. Also in this case, Fi(z) = Fo(z) = F(z) = 1.

If you set ThiranOrder to a non-zero value, c2d approximates the fractional portion of the time delays by Thiran filters Fi(z), Fo(z), and F(z).

The Thiran filters add additional states to the model. The maximum number of additional states for each delay is ThiranOrder.

For example, for the input delay τi, the order of the Thiran filter Fi(z) is:

order(Fi(z)) = max(ceil(τi/Ts), ThiranOrder).

If ceil(τi/Ts) < ThiranOrder, the Thiran filter Fi(z) approximates the entire input delay τi. If ceil(τi/Ts) > ThiranOrder, the Thiran filter only approximates a portion of the input delay. In that case, c2d represents the remainder of the input delay as a chain of unit delays z–mi, where

mi = ceil(τi/Ts) – ThiranOrder

c2d uses Thiran filters and ThiranOrder in a similar way to approximate the output delay τo and the internal delay τ.

When you discretizetf and zpk models using the Tustin method, c2d first aggregates all input, output, and transport delays into a single transport delay τTOT for each channel. c2d then approximates τTOT as a Thiran filter and a chain of unit delays in the same way as described for each of the time delays in ss models.

For more information about Thiran filters, see the thiran reference page and [4].

Zero-Pole Matching Equivalents

This method of conversion, which computes zero-pole matching equivalents, applies only to SISO systems. The continuous and discretized systems have matching DC gains. Their poles and zeros are related by the transformation:

zi=esiTs

where:

  • zi is the ith pole or zero of the discrete-time system.

  • si is the ith pole or zero of the continuous-time system.

  • Ts is the sample time.

See [2] for more information.

Zero-Pole Matching for Systems with Time Delays

You can use zero-pole matching to discretize SISO continuous-time models with time delay, except that the method does not support ss models with internal delays. The zero-pole matching method handles time delays in the same way as the Tustin approximation. See Tustin Approximation for Systems with Time Delays.

Least Squares

The least squares method minimizes the error between the frequency responses of the continuous-time and discrete-time systems up to the Nyquist frequency using a vector-fitting optimization approach. This method is useful when you want to capture fast system dynamics but must use a larger sample time, for example, when computational resources are limited.

This method is supported only by the c2d function and only for SISO systems.

As with Tustin approximation and zero-pole matching, the least squares method provides a good match between the frequency responses of the original continuous-time system and the converted discrete-time system. However, when using the least squares method with:

  • The same sample time as Tustin approximation or zero-pole matching, you get a smaller difference between the continuous-time and discrete-time frequency responses.

  • A lower sample time than what you would use with Tustin approximation or zero-pole matching, you can still get a result that meets your requirements. Doing so is useful if computational resources are limited, since the slower sample time means that the processor must do less work.

References

[1] Åström, K.J. and B. Wittenmark, Computer-Controlled Systems: Theory and Design, Prentice-Hall, 1990, pp. 48-52.

[2] Franklin, G.F., Powell, D.J., and Workman, M.L., Digital Control of Dynamic Systems (3rd Edition), Prentice Hall, 1997.

[3] Smith, J.O. III, "Impulse Invariant Method", Physical Audio Signal Processing, August 2007. https://www.dsprelated.com/dspbooks/pasp/Impulse_Invariant_Method.html.

[4] T. Laakso, V. Valimaki, "Splitting the Unit Delay", IEEE Signal Processing Magazine, Vol. 13, No. 1, p.30-60, 1996.

See Also

Functions

  • c2d | d2c | c2dOptions | d2cOptions | d2d | d2dOptions | thiran

Live Editor Tasks

  • Convert Model Rate

Related Topics

  • Discretize a Compensator
  • Improve Accuracy of Discretized System with Time Delay
  • Convert Discrete-Time System to Continuous Time

MATLAB Command

You clicked a link that corresponds to this MATLAB command:

 

Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.

Continuous-Discrete Conversion Methods- MATLAB & Simulink (7)

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list:

Americas

  • América Latina (Español)
  • Canada (English)
  • United States (English)

Europe

  • Belgium (English)
  • Denmark (English)
  • Deutschland (Deutsch)
  • España (Español)
  • Finland (English)
  • France (Français)
  • Ireland (English)
  • Italia (Italiano)
  • Luxembourg (English)
  • Netherlands (English)
  • Norway (English)
  • Österreich (Deutsch)
  • Portugal (English)
  • Sweden (English)
  • Switzerland
    • Deutsch
    • English
    • Français
  • United Kingdom (English)

Asia Pacific

  • Australia (English)
  • India (English)
  • New Zealand (English)
  • 中国
  • 日本 (日本語)
  • 한국 (한국어)

Contact your local office

Continuous-Discrete Conversion Methods
- MATLAB & Simulink (2024)

FAQs

Continuous-Discrete Conversion Methods - MATLAB & Simulink? ›

sysc = d2c( sysd ) converts a the discrete-time dynamic system model sysd to a continuous-time model using zero-order hold on the inputs. sysc = d2c( sysd , method ) specifies the conversion method. sysc = d2c( sysd , opts ) specifies conversion options for the discretization.

How do you convert discrete to continuous in Matlab? ›

sysc = d2c( sysd ) converts a the discrete-time dynamic system model sysd to a continuous-time model using zero-order hold on the inputs. sysc = d2c( sysd , method ) specifies the conversion method. sysc = d2c( sysd , opts ) specifies conversion options for the discretization.

What is discrete and continuous in Simulink? ›

The standard Simulink block set includes continuous blocks and discrete blocks. Continuous blocks respond continuously to continuously changing input. Discrete blocks, by contrast, respond to changes in input only at integer multiples of a fixed interval called the block's sample time.

What is the difference between continuous and discrete in Matlab? ›

A state for the discrete solver consists only of values. A state for the continuous solver has values AND state derivatives. In very plain terms, the continuous solvers are used (required) when you have continuous states, for example when using a continuous integrator or derivative block.

Which of the following methods converts continuous space into discrete? ›

Discretization is the process of converting a continuous function or model into discrete steps. It involves mapping continuous functions to sequences of discrete values.

How to convert continuous signal to discrete signal in Matlab Simulink? ›

  1. Continuous-Discrete Conversion Methods.
  2. Zero-Order Hold. ZOH Method for Systems with Time Delays.
  3. First-Order Hold. FOH Method for Systems with Time Delays.
  4. Impulse-Invariant Mapping. Impulse-Invariant Mapping for Systems with Time Delays.
  5. Tustin Approximation. ...
  6. Zero-Pole Matching Equivalents. ...
  7. Least Squares.
  8. References.

Can you convert discrete data to continuous data? ›

It is not possible to apply a simple transformation to discrete data to obtain continuous data. So can you apply continuous methods of analysis to those data, even though they're technically discrete? Yes! We do this all the time.

What is the difference between discrete and continuous solver in Simulink? ›

Continuous solvers rely on the individual blocks to compute the values of the model's discrete states at each time step. Discrete solvers exist primarily to solve purely discrete models. They compute the next simulation time step for a model and nothing else.

What are the 3 differences of discrete and continuous? ›

The key differences are: Discrete data is the type of data that has clear spaces between values. Continuous data is data that falls in a constant sequence. Discrete data is countable while continuous — measurable.

What is discrete function in Matlab? ›

The discrete-time system models are representational schemes for digital filters. The MATLAB® technical computing environment supports several discrete-time system models, which are described in the following sections: Transfer Function. Zero-Pole-Gain. State Space.

What is a continuous to discrete conversion called? ›

Explanation: To convert a signal from continuous time to discrete time, a process called sampling is used. The value of the signal is measured at certain intervals in time. Each measurement is referred to as a sample. (The analog signal is also quantized in amplitude, but that process is ignored in this demonstration.

What is the formula for discrete to continuous conversion? ›

Discrete and continuous interest

dx(t)dt=rertx(0)=rx(t), and the continuous growth rate is r. Hence, if we take a discrete growth rate (or interest rate) of r, it corresponds to a continuous growth rate of loge(1+r).

How do you convert a discrete signal to a continuous signal? ›

The answer is basically the sampling theory: you need to sample (uniformly) twice of the highest frequency of your analog signal, so you can reconstruct the original continuous time signal precisely by passing the sampled signals (the discrete time signals) through a low pass filter with high enough cut off frequency ( ...

How do you convert discrete rate to continuous rate? ›

Discrete and continuous interest

dx(t)dt=rertx(0)=rx(t), and the continuous growth rate is r. Hence, if we take a discrete growth rate (or interest rate) of r, it corresponds to a continuous growth rate of loge(1+r).

How to convert categorical variables into continuous variables? ›

The easiest way to convert categorical variables to continuous is by replacing raw categories with the average response value of the category.

Top Articles
54 Gas Stations That Accept EBT/Food Stamps Near Me In 2024! - DollarSlate
SNAP EBT grocery delivery & pickup - Walmart.com
Steve Bannon Issues Warning To Donald Trump
'That's Hilarious': Ahsoka's Ezra Bridger Actor Reveals Surprising True-To-Life Detail Behind Sabine Reunion Scene
Karl Torp Height
19 Awesome Things to Do in Redmond, Oregon
Gasbuddy Joliet
Ray Romano Made a Movie for Sports Parents Everywhere
Craigslist The Big Island
Edutone Skyward
Atrium Attorney Portal
Survivor Australia Wiki
Evil Dead Rise Showtimes Near Amc Antioch 8
123Movies The Idol
Sarah Lindstrom Telegram
Butte County Court Oroville Ca
Rick Harrison Daughter Ciana
Ohio Lottery Full Site
Chs.mywork
20 of the Funniest Obituaries That Will Have You Dying Laughing
What Is a Food Bowl and Why Are They So Popular?
Walmart Neighborhood Market Gas Price
Power Supplemental Payment 2022 Round 4
Cocaine Bear Showtimes Near Amc Braintree 10
Syracuse Deadline
Elven Signet Osrs
Ihub Fnma Message Board
Ecem Hotoglu
phoenix health/wellness services - craigslist
Kbh Client Portal
Paying Cash for Comics, Sports Cards, Collections, Honest - Respectful - wanted - by dealer - sale - craigslist
Panty Note Manga Online
Orbison Roy: (1936 1988) American Singer. Signed 7 X 9
Language levels - Dutch B1 / 2 –What do these language levels mean? - Learn Dutch Online
Linktree Teentinyangel
Trailmaster Fahrwerk - nivatechnik.de
Www Spherionnetwork.com
Deborah Clearbranch Psychologist Georgia
Miawaiifu
Surface Area Formulas (video lessons, examples, step-by-step solutions)
Babyboo Fashion vouchers, Babyboo Fashion promo codes, Babyboo Fashion discount codes, coupons, deals, offers
R/Moissanite
O'reilly's In Mathis Texas
Craigs List Outdoor Furniture
Cetaphil Samples For Providers
Pastel Pink Facetime Icon
Gatlinburg SkyBridge: Is It Worth the Trip? An In-Depth Review - Travel To Gatlinburg
Hughie Francis Foley
Jami Lafay Gofundme
Swag Codes: The Ultimate Guide to Boosting Your Swagbucks Earnings - Ricky Spears
Costco Gas Prices Sioux Falls
Latest Posts
Article information

Author: Ray Christiansen

Last Updated:

Views: 6293

Rating: 4.9 / 5 (69 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Ray Christiansen

Birthday: 1998-05-04

Address: Apt. 814 34339 Sauer Islands, Hirtheville, GA 02446-8771

Phone: +337636892828

Job: Lead Hospitality Designer

Hobby: Urban exploration, Tai chi, Lockpicking, Fashion, Gunsmithing, Pottery, Geocaching

Introduction: My name is Ray Christiansen, I am a fair, good, cute, gentle, vast, glamorous, excited person who loves writing and wants to share my knowledge and understanding with you.