Discretizing a transfer function from s-domain (continuous) to z-domain (discrete) – x-engineer.org (2024)

Discretization is the process through which a continuous system (function/equation) is converted into a discrete system (function/equation). In engineering applications we use computers and microcontrollers to carry out computing and control tasks. These machines need discretized mathematical models of the control functions, which are suitable for numerical implementation and evaluation.

Every time a continuous system is discretized, there will be some level of discretization error. This happens because the discretized model is an approximation of the continuous model.

Image: Transfer function discretization

In the Control System domain, through discretization, a transfer function H(s) is converted from the s-domain (Laplace) into the z-domain (discrete) transfer function H(z).

There are several techniques (methods) for transfer function discretization, the most common being:

  • Forward Euler (difference) discretization
  • Backward Euler (difference) discretization
  • Trapezoidal (Tustin) discretization

As discretization example we are going to use the transfer function of a first order system (also known as a low-pass filter):

\[H(s) = \frac{1}{T_{c} \cdot s + 1} \tag{1}\]

where Tc [s] is the time constant of the system.

We can implement the first order system transfer function in an Xcos block diagram and plot its response to a step input.

Image: Continuous system – step input time response

This step input response is going to be used as a comparison baseline with the discretized systems.

Image: Step input system response – continuous system

Using the discretization methods above, we are going to convert the transfer function of the first order system H(s) from continuous time domain (s) to discrete time domain (z).

Forward Euler (difference) discretization

In the forward Euler discretization method, the variable s is replaced with:

\[s = \frac{z-1}{T_{s}} \tag{2}\]

where Ts [s] is the sampling time.The lower the value of the sampling time, the lower the discretization (quantization) error.

Replacing (2) in (1) and doing the several transformations and simplifications, we get (3):

\[ \begin{split}
H(z) &= \frac{1}{T_{c} \cdot \frac{z-1}{T_{s}} + 1} = \frac{1}{T_{c} \cdot \frac{z-1}{T_{s}} + \frac{T_{s}}{T_{s}}} = \frac{1}{\frac{1}{T_{s}} \left ( T_{c} \cdot (z-1) + T_{s} \right )} = \\
&= \frac{T_{s}}{T_{c} \cdot (z-1) + T_{s}} = \frac{T_{s}}{T_{c} \cdot z \cdot (1 – z^{-1}) + T_{s}} = \frac{T_{s} \cdot z^{-1}}{T_{c} \cdot (1 – z^{-1})+T_{s}}
\end{split} \]

We know that any transfer function of a system is defined as the ratio between the output and the input:

\[H(z) = \frac{Y(z)}{U(z)} \tag{4}\]

Replacing (4) in (3) gives:

\[\frac{Y(z)}{U(z)} = \frac{T_{s} \cdot z^{-1}}{T_{c} \cdot (1 – z^{-1})+T_{s}} \tag{5}\]

Multiplying the left and right members of the equation (5) gives:

\[ T_{s} \cdot U(z) \cdot z^{-1} = T_{c} \cdot \left ( Y(z) – Y(z) \cdot z^{-1} \right ) + Y(z) \cdot T_{s} \tag{6}\]

Next, we are making the following substitutions:

\[ \begin{split}
U(z) \cdot z^{-1} &= u[k-1] \\
Y(z) \cdot z^{-1} &= y[k-1] \\
Y(z) &= y[k]
\end{split} \]

where [k] is the calculation step. Rearranging the terms, gives:

\[T_{s} \cdot u[k-1] = y[k] \cdot \left ( T_{c} + T_{s} \right ) – T_{c} \cdot y[k-1] \tag{7}\]

which gives the expression of the output y[k] as:

\[ \bbox[#FFFF9D]{y[k] = \frac{1}{T_{c} + T_{s}} \left ( T_{s} \cdot u[k-1] + T_{c} \cdot y[k-1] \right )} \tag{8}\]

As you can see, the discretized version (forward Euler) of the first order system is made up entirely of algebraic operations. This allows the equation to be encoded into programming languages (like C, C++) and run on microcontrollers.

The [k] values represent the values at the current calculation step and the [k-1] values represent the values at the previous calculation step. For example u[k-1] is the value of the input signal at the previous calculation step and y[k-1] is the value of the output at previous calculation step.

To verify if the discretized function gives the same output for a step response as the continuous version (equation (1)), we are going to implement equation (8) in Xcos as a block diagram.

Image: Discrete system (forward Euler) for first order system – Xcos block diagram

Running the model with a sample time of 0.01 s will result in the same output as for the continuous system.

Image: Discrete system (forward Euler) for first order system – step input response

Backward Euler (difference) discretization

In the backward Euler discretization method, the variable s is replaced with:

\[s = \frac{z-1}{z \cdot T_{s}} = \frac{1 – z^{-1}}{T_{s}} \tag{9}\]

where Ts [s] is the sampling time.

Replacing (9) in (1) and doing the several transformations and simplifications, we get:

\[H(z) = \frac{1}{T_{c} \cdot \frac{1 – z^{-1}}{T_{s}} + 1} = \frac{T_{s}}{T_{c} \cdot (1 – z^{-1}) + T_{s}} \tag{10}\]

We know that any transfer function of a system is defined as the ratio between the output and the input:

\[H(z) = \frac{Y(z)}{U(z)} \tag{11}\]

Replacing (11) in (10) gives:

\[\frac{Y(z)}{U(z)} = \frac{T_{s}}{T_{c} \cdot (1 – z^{-1}) + T_{s}} \tag{12}\]

Multiplying the left and right members of the equation (12) gives:

\[ T_{s} \cdot U(z) = T_{c} \cdot \left ( Y(z) – Y(z) \cdot z^{-1} \right ) + Y(z) \cdot T_{s} \tag{13}\]

Next, we are making the following substitutions:

\[ \begin{split}
U(z) &= u[k] \\
Y(z) \cdot z^{-1} &= y[k-1] \\
Y(z) &= y[k]
\end{split} \]

and rearranging the terms, gives:

\[T_{s} \cdot u[k] = y[k] \cdot \left ( T_{c} + T_{s} \right ) – T_{c} \cdot y[k-1] \tag{14}\]

which gives the expression of the output y[k] as:

\[ \bbox[#FFFF9D]{y[k] = \frac{1}{T_{c} + T_{s}} \left ( T_{s} \cdot u[k] + T_{c} \cdot y[k-1] \right )} \tag{15}\]

To verify if the discretized function gives the same output for a step response as the continuous version (equation (1)), we are going to implement equation (15) in Xcos as a block diagram.

Image: Discrete system (backward Euler) for first order system – Xcos block diagram

Running the model with a sample time of 0.01 s will result in the same output as for the continuous system.

Image: Discrete system (forward Euler) for first order system – step input response

Trapezoidal (Tustin) discretization

In the backward Euler discretization method, the variable s is replaced with:

\[s = \frac{2}{T_{s}} \cdot \frac{z-1}{z+1} \tag{16}\]

where Ts [s] is the sampling time.

Replacing (16) in (1) and doing the several transformations and simplifications, we get (17):

\[ \begin{split}
H(z) &= \frac{1}{T_{c} \cdot \frac{2}{T_{s}} \cdot \frac{z-1}{z+1} + 1} = \frac{T_{s} \cdot (z+1)}{2 \cdot T_{c} \cdot (z-1) + T_{s} \cdot (z+1)} = \\
&= \frac{T_{s} \cdot z \cdot (1 + z^{-1})}{2 \cdot T_{c} \cdot z \cdot (1 – z^{-1}) + T_{s} \cdot z \cdot (1+z^{-1})} = \frac{T_{s} \cdot (1+z^{-1})}{2 \cdot T_{c} \cdot (1-z^{-1}) + T_{s} \cdot (1+z^{-1})}
\end{split} \]

We know that any transfer function of a system is defined as the ratio between the output and the input:

\[H(z) = \frac{Y(z)}{U(z)} \tag{18}\]

Replacing (18) in (17) gives:

\[\frac{Y(z)}{U(z)} = \frac{T_{s} \cdot (1+z^{-1})}{2 \cdot T_{c} \cdot (1-z^{-1}) + T_{s} \cdot (1+z^{-1})} \tag{19}\]

Multiplying the left and right members of the equation (19) gives:

\[ U(z) \cdot T_{s} \cdot (1+z^{-1}) = Y(z) \cdot 2 \cdot T_{c} \cdot (1-z^{-1}) + Y(z) \cdot T_{s} \cdot (1+z^{-1}) \tag{20}\]

Next, we are making the following substitutions:

\[ \begin{split}
U(z) &= u[k] \\
U(z) \cdot z^{-1} &= u[k-1] \\
Y(z) \cdot z^{-1} &= y[k-1] \\
Y(z) &= y[k]
\end{split} \]

and rearranging the terms, gives:

\[T_{s} \cdot (u[k] + u[k-1]) = y[k] \cdot (2 \cdot T_{c} + T_{s}) + y[k-1] \cdot (T_{s} – 2 \cdot T_{c}) \tag{21}\]

which gives the expression of the output y[t] as:

\[ \bbox[#FFFF9D]{y[k] = \frac{1}{2 \cdot T_{c} + T_{s}} \left ( T_{s} \cdot (u[k] + u[k-1]) – (T_{s} – 2 \cdot T_{c}) \cdot y[k-1] \right )} \tag{22}\]

To verify if the discretized function gives the same output for a step response as the continuous version (equation (1)), we are going to implement equation (22) in Xcos as a block diagram.

Image: Discrete system (trapezoidal) – step input time response

Running the model with a sample time of 0.01 s will result in the same output as for the continuous system.

Image: Discrete system (trapezoidal / Tustin) for first order system – step input response

The same conversion methodologies can be applied to any continuous transfer function, the discretized model having the advantage that can be implemented in digital / electronic control systems.

Discretizing a transfer function from s-domain (continuous) to z-domain (discrete) – x-engineer.org (2024)

FAQs

How to convert S-domain transfer function to Z-domain? ›

In the Control System domain, through discretization, a transfer function H(s) is converted from the s-domain (Laplace) into the z-domain (discrete) transfer function H(z). There are several techniques (methods) for transfer function discretization, the most common being: Forward Euler (difference) discretization.

How to convert continuous to discrete? ›

  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.

What is the discretization of a system? ›

A. Discretization is the process of converting digital or binary data into a continuous function or system for more accurate computations in engineering domains. B.

What is the correct formula for the Tustin method of discretizing continuous time transfer functions? ›

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 = e s T s ≈ 1 + s T s / 2 1 − s T s / 2 .

What are the methods of discretization transfer function? ›

Discretization method

Available methods are: zero-order hold, Forward Euler, Backward Euler, and Bilinear (or Tustin).

What is the difference between Z-domain and S domain? ›

The s-domain is used to analyze signals in the analog domain, while the z-domain is used for discrete-time signals.

How to discretize a function? ›

Discretization is the process through which we can transform continuous variables, models or functions into a discrete form. We do this by creating a set of contiguous intervals (or bins) that go across the range of our desired variable/model/function. Continuous data is Measured, while Discrete data is Counted.

How do you discretize continuous values? ›

Equal-width discretization consists of dividing the range of continuous values into k equally sized intervals. Then, if the values of the variable vary between 0 and 100, the bins can be 0–20, 20–40, 40–60, 80–100. We can carry out equal-frequency discretization in Python using the open source library Feature-engine.

What is Discretisation method? ›

In applied mathematics, discretization is the process of transferring continuous functions, models, variables, and equations into discrete counterparts. This process is usually carried out as a first step toward making them suitable for numerical evaluation and implementation on digital computers.

How to convert continuous-time model to discrete-time model? ›

1 Answer
  1. Change the sample time of the sinewave to something that is non-zero. This will make it a discrete signal.
  2. Use a Zero Order Hold (as you've mentioned) to convert the signal to discrete, you will need to specify a sample time for this block to perform the conversion.
Dec 16, 2021

What is the Tustin transformation method? ›

The bilinear transform (also known as Tustin's method, after Arnold Tustin) is used in digital signal processing and discrete-time control theory to transform continuous-time system representations to discrete-time and vice versa. with first order all-pass filters.

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 I transfer data from one domain to another domain? ›

If you are also using a database, make sure to complete these steps as well:
  1. Create a new database for your new domain.
  2. Import your old database's backup to the newly created database.
  3. Update the URLs in the new database along with the configuration file on your website.

How do you convert Laplace transform to Z transform? ›

Laplace Transform can be converted to Z-transform by the help of bilinear Transformation. This transformation gives relation between s and z. s=(2/T)*{(z-1)/(z+1)} where, T is the sampling period. f=1/T , where f is the sampling frequency.

How do I switch from one domain to another? ›

Cancel your previous service.
  1. Make sure your domain is eligible for a transfer. ...
  2. Update your contact information. ...
  3. Set up your email sending domain name. ...
  4. Unlock your domain. ...
  5. Request an authorization code. ...
  6. Create an account with your new registrar. ...
  7. Enter the authorization code. ...
  8. Authorize the domain transfer.
Jan 16, 2023

Top Articles
Storing Hard Boiled Eggs, Whats Cooking America
French Onion Chicken
Spasa Parish
Rentals for rent in Maastricht
159R Bus Schedule Pdf
Sallisaw Bin Store
Black Adam Showtimes Near Maya Cinemas Delano
Espn Transfer Portal Basketball
Pollen Levels Richmond
11 Best Sites Like The Chive For Funny Pictures and Memes
Things to do in Wichita Falls on weekends 12-15 September
Craigslist Pets Huntsville Alabama
Paulette Goddard | American Actress, Modern Times, Charlie Chaplin
What's the Difference Between Halal and Haram Meat & Food?
R/Skinwalker
Rugged Gentleman Barber Shop Martinsburg Wv
Jennifer Lenzini Leaving Ktiv
Justified - Streams, Episodenguide und News zur Serie
Epay. Medstarhealth.org
Olde Kegg Bar & Grill Portage Menu
Cubilabras
Half Inning In Which The Home Team Bats Crossword
Amazing Lash Bay Colony
Juego Friv Poki
Ice Dodo Unblocked 76
Is Slatt Offensive
Labcorp Locations Near Me
Storm Prediction Center Convective Outlook
Experience the Convenience of Po Box 790010 St Louis Mo
Fungal Symbiote Terraria
modelo julia - PLAYBOARD
Abby's Caribbean Cafe
Joanna Gaines Reveals Who Bought the 'Fixer Upper' Lake House and Her Favorite Features of the Milestone Project
Tri-State Dog Racing Results
Navy Qrs Supervisor Answers
Trade Chart Dave Richard
Lincoln Financial Field Section 110
Free Stuff Craigslist Roanoke Va
Stellaris Resolution
Wi Dept Of Regulation & Licensing
Pick N Pull Near Me [Locator Map + Guide + FAQ]
Crystal Westbrooks Nipple
Ice Hockey Dboard
Über 60 Prozent Rabatt auf E-Bikes: Aldi reduziert sämtliche Pedelecs stark im Preis - nur noch für kurze Zeit
Wie blocke ich einen Bot aus Boardman/USA - sellerforum.de
Infinity Pool Showtimes Near Maya Cinemas Bakersfield
Hooda Math—Games, Features, and Benefits — Mashup Math
Dermpathdiagnostics Com Pay Invoice
How To Use Price Chopper Points At Quiktrip
Maria Butina Bikini
Busted Newspaper Zapata Tx
Latest Posts
Article information

Author: Mrs. Angelic Larkin

Last Updated:

Views: 6289

Rating: 4.7 / 5 (67 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Mrs. Angelic Larkin

Birthday: 1992-06-28

Address: Apt. 413 8275 Mueller Overpass, South Magnolia, IA 99527-6023

Phone: +6824704719725

Job: District Real-Estate Facilitator

Hobby: Letterboxing, Vacation, Poi, Homebrewing, Mountain biking, Slacklining, Cabaret

Introduction: My name is Mrs. Angelic Larkin, I am a cute, charming, funny, determined, inexpensive, joyous, cheerful person who loves writing and wants to share my knowledge and understanding with you.