mapping bode plot for Low Pass Filter
7 次查看(过去 30 天)
显示 更早的评论
Can someine please tell me what I am doing wrong with my code here
R = 1000;
C = 100*10^(-9);
tau = R*C;
w = 0:100:100000;
x = ((1-((w)*tau)^2)/((w)*tau)^2)+9;
G = 1/(sqrt(x));
plot(w,G);
0 个评论
回答(2 个)
Star Strider
2024-1-12
编辑:Star Strider
2024-1-12
You need to do element-wise exponentiation (.^) and division (./) —
R = 1000;
C = 100*10^(-9);
tau = R*C;
w = 0:100:100000;
x = ((1-((w)*tau).^2)./((w)*tau).^2)+9;
G = 1./(sqrt(x));
plot(w,G);
figure
semilogx(w,mag2db(G/max(G)))
axis('padded')
EDIT — Added second plot.
.
0 个评论
AMIT SURYAVANSHI
2024-1-13
%so u r dealing with vectors their is a mistake with the x variable and this line
&x = ((1-((w)*tau)^2)/((w)*tau)^2)+9;
%the correc ted code is
R = 1000;
C = 100 * 10^(-9);
tau = R * C;
w = 0:100:100000;
x = ((1 - ((w) * tau).^2) / ((w) * tau).^2) + 9;
G = 1 ./ sqrt(x);
plot(w, G);
%the last third line is corrrected with . operator which is used in the vector element by element %multiplication just be careful while using the vector decide wheather u want to use the normal vector %multiplication or elementwise multiplication
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Pulsed Waveforms 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!