I am trying to figure out how to get the corner frequency to show up on my bode plot or in the command window in matlab but everything i have tried doesn't work or gives me inf. is there any easy way to get the corner frequency (breakpoint) to show on the figure or the command window? here is what i have so far for my code:
w = logspace(-2,4,500);
num1 = [1 1];
den1 = [1];
num2 = [1 2 1];
den2 = [1];
sys1 = tf(num1,den1)
sys1 = s + 1 Continuous-time transfer function.
figure(1)
bode(sys1,w)
grid on
hold on
sys2 = tf(num2, den2)
sys2 = s^2 + 2 s + 1 Continuous-time transfer function.
figure(1)
bode(sys2, w, 'r')
grid on

3 comentarios

Adam Danz
Adam Danz el 17 de Nov. de 2022
Editada: Adam Danz el 17 de Nov. de 2022
Is your question how to calculate the corner frequencies or how to add markers to the plot to indicate those values? If you're stuck on the graphics end, include your calculations of the corner frequencies in your question, even if they are returning inf values. It will give us a starting point to guide you the rest of the way.
Have you seen this answer?
Star Strider
Star Strider el 17 de Nov. de 2022
@Adam Danz — Thank you for posting that reference!
Ethan Johnston
Ethan Johnston el 17 de Nov. de 2022
My question is how to add markers to the plot of those values. Sorry, I should have been more specific. I don't have any work that I calculated yet for it.

Iniciar sesión para comentar.

 Respuesta aceptada

Star Strider
Star Strider el 17 de Nov. de 2022
The ‘sys1’ and ‘sys2’ transfer functions are actually improper, wince with a denominator of 1, they are infinite differentiators.
As such, they have no corner frequencies.
To get the frequencies at any points in the frequency response that you want, use freqresp and interp1
w = logspace(-2,4,500);
num1 = [1 1];
den1 = [1];
num2 = [1 2 1];
den2 = [1];
sys1 = tf(num1,den1)
sys1 = s + 1 Continuous-time transfer function.
figure(1)
bode(sys1,w)
grid on
H1 = freqresp(sys1,w);
H1 = squeeze(H1);
sys1_dB6_radfreq = interp1(mag2db(abs(H1)),w, 6) % +6dB Radian Frequency
sys1_dB6_radfreq = 1.7266
hold on
sys2 = tf(num2, den2)
sys2 = s^2 + 2 s + 1 Continuous-time transfer function.
figure(1)
bode(sys2, w, 'r')
grid on
[H2,wout2] = freqresp(sys2,w);
H2 = squeeze(H2);
sys2_dB6_radfreq = interp1(mag2db(abs(H2)),w, 6) % +6dB Radian Frequency
sys2_dB6_radfreq = 0.9976
It is also possible to calculate where the phase reaches a certain value, however it may be necessary to restrict ‘w’ to a monotonically-increasing or -decreasing part of the spectrum in order to avoid problems with non-unique values.
.

2 comentarios

Ethan Johnston
Ethan Johnston el 17 de Nov. de 2022
Thank you! I really appreicate it! I'm still learning this topic and it has been hard to grasp but this helps out so much.
Star Strider
Star Strider el 18 de Nov. de 2022
As always, my pleasure!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Productos

Versión

R2021b

Preguntada:

el 17 de Nov. de 2022

Comentada:

el 18 de Nov. de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by