Transfer Function: Continuous approximation of discrete bode

8 views (last 30 days)
John
John on 31 Mar 2022
Edited: Paul on 31 Mar 2022
Is there a straightforward way to create a continuous-time transfer function (TF) from a discrete-time TF, that matches the discrete-time TF bode?
Basically, I'm trying to multiply two TFs (say, A and P) with different sampling times together (in Matlab). Mixed timing isn't allowed in Matlab, although if can easily be simulated in Simulink.
But I'm looking for an analytical result (not the result of a simulation), and need to use Matlab to find a resulting TF that describes the A*P behavior.
I'm trying to work around this by doing a trick: first convert a continuous-time TF, P, to a discrete-time TF -- and then find a continuous-time TF equivalent that matches the discrete's bode. Then, I can use that new continuous-time model for a multipication of two continuous-time TFs.
Here's an example:
Say I have a continuous-time TF called P. I discretize to get P_disc, which yields a different behavior (bode).
Now I want to convert this back -- somehow -- to get a continuous-time TF that matches it very closely, here called P_DiscBackToCont. Obviously, what I'm doing in the example doesn't work, so using d2c() is just an example.
How to make a continuous-time P_DiscBackToCont so that it matches P_disc?
figure
P_disc = c2d(P, Ts, 'zoh');
% How to make a continuous-time P_DiscBackToCont (yellow) match P_disc (red)?
P_DiscBackToCont = d2c(P_disc)
bode(P, P_disc, P_backToC, bodeOpts)
legend

Answers (1)

Paul
Paul on 31 Mar 2022
Edited: Paul on 31 Mar 2022
Hello @John
The second paragraph of the question states that P is a discrete-time transfer function. But later on the question states that P is a continuous time transfer function. Can this be clarified?
As for the plot, it's hard to say with certainty without seeing the details of P, but it sure looks like the Nyquist frequency of 1/2/Ts Hz is well within the bandwidth of P, so we would not expect that P_disc to be a good approximation to P.
Having said all of that, if I understand the question correctly one approach to consider is to use d2d on the tf with smaller sampling period and bring it up to the larger sampling period and then take the product. For example
P = tf(1,[1 -0.5],0.2);
A = tf(1,[1 -0.1],0.5);
figure;
bode(P,A,d2d(P,.5,'tustin')*A)
legend('P','A','P*A','Location','SouthWest')
Check the doc page on d2d() for discussion of various options.
,

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!