Bode different phase issue
6 ビュー (過去 30 日間)
古いコメントを表示
Hello,
I have a homework. I have a transfer function which is related to butterworth low pass filter. Teacher asks me phase and amplitude response, and bode diagram separately. I use freqs(num,den) for the phase and amplitude response. I use bode(sys) for the bode diagram. When I compare the outputs, amplitude responses are quite similar. But phase responses are quite different. You can see the outputs and my codes.
Here is my code:
>> wp = 1;
>> ws = 1.2;
>> Rp = 0.2;
>> Rs = 25;
>> [n, Wn] = buttord(wp,ws,Rp,Rs,'s');
>> [num, den] = butter(n, Wn, 's');
>> sys = tf(num, den);
Continuous-time transfer function.
>> bode(sys)
>> freqs(num, den)
bode(sys) output:
freqs(num, den) output:
Is it necessary to see them similar or same? Could you please explain me?
Thanks in advance.
0 件のコメント
回答 (1 件)
Star Strider
2022 年 10 月 21 日
In the freqs call, the phase is wrapped. Unwrap it and freqs matches bode —
wp = 1;
ws = 1.2;
Rp = 0.2;
Rs = 25;
[n, Wn] = buttord(wp,ws,Rp,Rs,'s');
[num, den] = butter(n, Wn, 's');
sys = tf(num, den);
sys
figure
bode(sys)
figure
freqs(num,den, 1E+2)
Ax2 = get(subplot(2,1,2));
Line = Ax2.Children;
Ax2.Children.YData = rad2deg(unwrap(deg2rad(Line.YData)));
.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Get Started with Control System Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!