フィルターのクリア

Matlab - Bode plot of discrete and continuous Function

101 ビュー (過去 30 日間)
Martin Werner
Martin Werner 2019 年 10 月 14 日
回答済み: Paul 2023 年 2 月 24 日
I am rather new to Matlab and I just cant make sense of what I see in the bode plot of the continuous and discrete version of the same function. The bode plot of the continuous function looks as expected. However the bode plot of the discrete version has a phase offset of +90 degrees and the gain stays the same at lower frequencies. It's basically a lag compensator with an integrator. This is not the final result I am going for, but the easiest example I could think of to make the problem as clear as possible. Please note that I am using a rather high sampling rate of ~12 MHz, which is what I need in the final hardware design. The high sampling rate seems to be part of the problem. With lower sampling rates the frequency at which the bode plots differ gets shifted to the left.
Can anyone explain this behaviour and maybe how I can achieve a result that is closer to the continuous bode plot using the high sampling rate?
Code of the example:
FS = 48000*256;
T_sample = 1/FS;
accu = tf([0 1], [1 0]);
lag = tf([10 1], [100 1]);
lag_d = c2d(lag, T_sample, "zoh");
accu_d = c2d(accu, T_sample, "zoh");
bode(lag*accu, lag_d*accu_d);
  2 件のコメント
Benjamin Pommer
Benjamin Pommer 2023 年 2 月 24 日
Had you been finding an answer to that problem? I am struggeling with the same thing?
Luca Ferro
Luca Ferro 2023 年 2 月 24 日
it doesn't make any sense to bode plot a discrete transfer function.
Bode is defined in the Laplace domain (s) while discrete transfer functions are in the z domain.
It's like putting a cat in a pool and expecting it to behave like a fish.

サインインしてコメントする。

採用された回答

Paul
Paul 2023 年 2 月 24 日
One problem is that the discretization of the product is not the product of the discretization. But with T_sample so small, that's probably not the issue. It appears that bode is having a problem with numerical calculations in the tf form. Instead, use zpk. zpk is preferred over tf in most (all?) cases.
FS = 48000*256;
T_sample = 1/FS;
accu = tf([0 1], [1 0]);
lag = tf([10 1], [100 1]);
htf = lag*accu;
hzpk = zpk(lag)*zpk(accu);
hzpkd = c2d(hzpk,T_sample,'zoh');
%lag_d = c2d(lag, T_sample, "zoh");
%accu_d = c2d(accu, T_sample, "zoh");
bode(htf, hzpk, hzpkd);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with Control System Toolbox についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by