2
$\begingroup$

I need to transform this Laplace function to the z-domain:

enter image description here

From the answer I received:

$s=(1-z^{−1})/T$

Then substitution into my Laplace function would give:

$t(z) = 2R/(m*(1-z^{−1})/T + 2R)$

Is that it?

Then $z$ is the input signal's current sample? Is $z^{-1}$ is the input signal delayed by one sample?

ie. Is it:

output_of_function = 2*R / (m* (1 - input_signal_1)/T + 2*R)

What basic mechanism might this function expect to perform? Eg. a LPF? Or what?

Does the fact that you're subtracting $z^{-1}$ from 1 imply that the input must be between -1 and 1?

Thanks. (I edited this in reply to the answer given from Matt L which helped.)

$\endgroup$
5
$\begingroup$

First of all, it's important to understand that there is no single best way to transform a continuous-time system to a discrete-time system. The method you're using is called backward Euler method, and it is defined by the mapping

$$s\leftarrow\frac{1-z^{-1}}{T}\tag{1}$$

Note that in $(1)$ you scale by $1/T$, where $T$ is the sampling interval (i.e., $1/T$ is the sampling frequency). Eq. $(1)$ just means that continuous-time differentiation (multiplication by $s$) is approximated by a first-order backward difference ($z^{-1}$ corresponds to a delay by $1$ sample). This and other methods for converting continuous-time systems to discrete-time systems are discussed in this answer.

Here is an example where I chose an arbitrary frequency range of interest $f\in[0,10]$, and an appropriate sampling frequency $1/T=20$. The figure below shows the frequency response of the continuous-time system (in blue), and the frequency response of the discrete-time system (in green), which was transformed from the continuous-time system according to $(1)$.

enter image description here

| improve this answer | |
$\endgroup$
  • $\begingroup$ Thanks Matt. It looks like my substitution for $s$ was wrong then. I updated my question based on your substitution given. Does it look right now? Can you answer any of the few small remaining questions in my post? Thanks. $\endgroup$ – mike Dec 4 '19 at 16:45
  • $\begingroup$ @mike: Multiplication by $z^{-1}$ in the transform domain corresponds to a delay by one sample. And 'no' to your question about the input required to be between -1 and +1. $\endgroup$ – Matt L. Dec 4 '19 at 17:45
  • $\begingroup$ Take a look at this question and its answers for more information on the Z-transform. $\endgroup$ – Matt L. Dec 4 '19 at 17:46
  • $\begingroup$ I would be strict and say $s \simeq \frac{1 - z^{-1}}{T}$ (note the $\simeq$ as opposed to $=$) for the backwards Euler. Also, depending on your problem, there's the forwards Euler, $s \simeq \frac{z - 1}{T}$, and the Tustin transformation: $s \simeq \frac{2(z - 1)}{T(z + 1)}$. None of these are exact, and every one of them gets less accurate as the frequency goes up, and there are other approximation methods. So pick your poison... $\endgroup$ – TimWescott Dec 5 '19 at 0:00
  • $\begingroup$ Thanks. For some reason the Euler didn't work at all. But the Tustin works perfectly. Maybe I fucked up the Euler but either way it's working with Tustin. $\endgroup$ – mike Dec 5 '19 at 3:41
0
$\begingroup$

I don't know why but I couldn't get the equations to output any audio when using the Euler method given. Maybe I screwed it up somehow or this is not the best place for that type of approximation.

When I substituted $s=(2(z^{-1}−1))/(T(z^{-1}+1))$ it works perfectly. So problem solved either way. Thanks.

| improve this answer | |
$\endgroup$
  • $\begingroup$ One of the properties of the Tustin approximation that the Euler approximations lack is that for a stable transfer function in $s$, the Tustin will give you a stable transfer function in $z$. With Euler, a transfer function with poles that are high frequency with respect to the sampling rate will end up being unstable. So it could be that your starting transfer function had one or more high-frequency poles in $s$ that mapped to an unstable pole in $z$ using the Euler method. $\endgroup$ – TimWescott Dec 5 '19 at 16:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.