Bode different phase issue
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (1)
Star Strider
am 21 Okt. 2022
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 Kommentare
Siehe auch
Kategorien
Mehr zu Get Started with Control System Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!