Matlab bode plot with specific cut off frequency

조회 수: 3 (최근 30일)
Aaron Frost
Aaron Frost 2023년 2월 21일
댓글: Star Strider 2023년 2월 21일
This scrip displays a bode diagram however the cut off frequency is incorrect. I need the cut off frequency to be 15kHz whilst showing the gain to be 27dB. Does anyone have an idea how I can achieve this? Thank in advance.
clc
format long
C1 = 0.000000000150;
C2 = 0.000000000470;
R1 = 10000;
R2 = 180000;
R3 = 2700;
R4 = 56000;
G = (R3+R4)/R3;
A = 1/(C1*R2)
B = 1/(C2*R2)
C = (1/(C1*R1))*(1-G)
D = 1/(C1*C2*R1*R2)
E = (A+B+C)
%{
Numerator = {[G 0 0] };
Denominator = {[1 0] [A] [B] [C] [0 D]};
T = tf(Numerator, Denominator)
Numerator = {[G 0 0] };
Denominator = {[1 (A+B+C) D]};
T = tf(Numerator, Denominator)
%}
%{
T = tf([G 0 0], [1 (A+B+C) D]);
%}
%T = tf([21.740 0 0], [1 1.418439716*10^4 5.263157895*10^-6]);
T = tf([G 0 0], [1 E D]);
%T = tf([21.740740740741 0 0], [1 -13778303.125821 7880220646.1781])
options = bodeoptions;
options.FreqUnits = 'Hz'; % or 'rad/second', 'rpm', etc.
bode(T,options);
grid on
Im looking to achieve something like this.

답변 (1개)

Star Strider
Star Strider 2023년 2월 21일
The easiest option may be to define the radian frequency function:
w = linspace(0, 1.5E+4, 1E+3)*2*pi;
and then supply it as an argument to bode
clc
format long
C1 = 0.000000000150;
C2 = 0.000000000470;
R1 = 10000;
R2 = 180000;
R3 = 2700;
R4 = 56000;
G = (R3+R4)/R3;
A = 1/(C1*R2);
B = 1/(C2*R2);
C = (1/(C1*R1))*(1-G);
D = 1/(C1*C2*R1*R2);
E = (A+B+C);
%{
Numerator = {[G 0 0] };
Denominator = {[1 0] [A] [B] [C] [0 D]};
T = tf(Numerator, Denominator)
Numerator = {[G 0 0] };
Denominator = {[1 (A+B+C) D]};
T = tf(Numerator, Denominator)
%}
%{
T = tf([G 0 0], [1 (A+B+C) D]);
%}
%T = tf([21.740 0 0], [1 1.418439716*10^4 5.263157895*10^-6]);
T = tf([G 0 0], [1 E D]);
%T = tf([21.740740740741 0 0], [1 -13778303.125821 7880220646.1781])
w = linspace(0, 1.5E+4, 1E+3)*2*pi;
options = bodeoptions;
options.FreqUnits = 'Hz'; % or 'rad/second', 'rpm', etc.
bode(T,w,options);
grid on
.
  댓글 수: 2
Aaron Frost
Aaron Frost 2023년 2월 21일
Sorry I forgot to mention that I need to gain to be visible showing 27dB
This is what im looking to achieve but it needs to be with matlab
Star Strider
Star Strider 2023년 2월 21일
Try something like this —
% clc
format long
C1 = 0.000000000150;
C2 = 0.000000000470;
R1 = 10000;
R2 = 180000;
R3 = 2700;
R4 = 56000;
G = (R3+R4)/R3;
A = 1/(C1*R2);
B = 1/(C2*R2);
C = (1/(C1*R1))*(1-G);
D = 1/(C1*C2*R1*R2);
E = (A+B+C);
%{
Numerator = {[G 0 0] };
Denominator = {[1 0] [A] [B] [C] [0 D]};
T = tf(Numerator, Denominator)
Numerator = {[G 0 0] };
Denominator = {[1 (A+B+C) D]};
T = tf(Numerator, Denominator)
%}
%{
T = tf([G 0 0], [1 (A+B+C) D]);
%}
%T = tf([21.740 0 0], [1 1.418439716*10^4 5.263157895*10^-6]);
T = tf([G 0 0], [1 E D]);
%T = tf([21.740740740741 0 0], [1 -13778303.125821 7880220646.1781])
w = logspace(-3, log10(1.5E+8), 1E+3)*2*pi;
options = bodeoptions;
options.FreqUnits = 'Hz'; % or 'rad/second', 'rpm', etc.
bode(T,w,options);
grid on
Fx = gcf;
Kids = Fx.Children;
MagPlot = Kids(3);
YdB = MagPlot.YLim
YdB = 1×2
-3.000000000000000 0.267445587351631
Ymag = db2mag(YdB)
Ymag = 1×2
0.000000000000001 21.738418068660366
.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by