Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

l1=127*10^(-9);

l2=0.726*10^(-9);
l3=l1;
c1=0.199*10^(-12);
c2=34.91*10^(-12);
c3=c1;
z=50;
p=1:1*10^4:1*10^10;
for i = 1:1:length(p)
s=2*pi*p(i);
A=[ 1 1i*s*l1; 0 1];
B=[ 1 1i*s*c1; 0 1];
C=[ 1 0; 1i*s*l2 1];
D=[ 1 0; 1i*s*c2 1];
E=A;
F=B;
answer=A*B*C*D*E*F;
a=answer(1,1);
b=answer(1,2);
c=answer(2,1);
d=answer(2,2);

denominator=a+(b/z)+(c*z)+d;

s11(i)=(a+(b/z)-(c*z)-d)/denominator;
s21(i)=2/denominator;

end

s1db=20*log10(s11);
s2db=20*log10(s21);
subplot(2,1,1);
plot(p,abs(s2db),'r-',p,abs(s1db),'b-');
title('amplitude response');
xlabel('freq');
ylabel('mag');
subplot(2,1,2);
plot(p,angle(s2db),'r-',p,angle(s1db),'b-');
axis([ p(1) p(length(p))-pi pi]);
title('phase response');
xlabel('freq');
ylabel('angle');

You might also like