Plotting the bode plot of a high pass filter using matlab
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I am trying to theoretically find the frequency response of the circuit given below:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1693966/image.png)
Firstly i found the impedance value of the RC Ladder by applying the equation below, then i defined this as "Z" in my MatLab Code.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1693971/image.png)
Afterwards i wrote a matlab code to plot the filter's frequency response. Matlab Code is given below, the required nominal values shown in the schematic are defined in the code.
f = logspace(0, 5, 1000);
w=2*pi.*f;
s=1i.*w;
Ro=11960e3;
R1=2.17e3;
R2=118.44e3;
R3=496.82e3;
R4=1220e3;
R5=2530e3;
C1=536.29e-12;
C2=217.23e-12;
C3=201.41e-12;
C4=263.35e-12;
C5=556.27e-12;
Rload=200e3;
Z=((1/Ro)+(R1+(1./(s*C1)))+(R2+(1./(s*C2)))+(R3+(1./(s*C3)))+(R4+(1./(s*C4)))+(R5+(1./(s*C5)))).^-1;
H=abs(Rload./(Z+Rload));
semilogx(f, 20*log10(H))
The LTSpice plot (expected one) is like this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1693976/image.png)
My Matlab Plot is like this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1693981/image.png)
My mathematical approach seems correct to me let me know if i have anything missing on that part. I am unsure about the code, please let me know if there is something missing in code or my mathematical approach.
0 commentaires
Réponses (1)
Star Strider
le 13 Mai 2024
The ‘H’ calculation may be reversed. (I can’t read the axis values on the LTSpice plot image.)
Perhaps this —
f = logspace(0, 5, 1000);
w=2*pi.*f;
s=1i.*w;
Ro=11960e3;
R1=2.17e3;
R2=118.44e3;
R3=496.82e3;
R4=1220e3;
R5=2530e3;
C1=536.29e-12;
C2=217.23e-12;
C3=201.41e-12;
C4=263.35e-12;
C5=556.27e-12;
Rload=200e3;
Z=((1/Ro)+(R1+(1./(s*C1)))+(R2+(1./(s*C2)))+(R3+(1./(s*C3)))+(R4+(1./(s*C4)))+(R5+(1./(s*C5)))).^-1;
H=abs(Z./(Z+Rload));
semilogx(f, 20*log10(H))
.
0 commentaires
Voir également
Catégories
En savoir plus sur Pole and Zero Locations dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!