Bode different phase issue
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1164763/image.jpeg)
freqs(num, den) output:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1164768/image.jpeg)
Is it necessary to see them similar or same? Could you please explain me?
Thanks in advance.
0 Commenti
Risposte (1)
Star Strider
il 21 Ott 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 Commenti
Vedere anche
Categorie
Scopri di più su Get Started with Control System Toolbox in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!