S-Parameters to LC values Algorithn
古いコメントを表示
Hi experts,
I wrote a manual solution for a single resonator coupled to input and output terminated with 50 ohm terminations. Transformed it into an equivalent T-network circuit model and wrote the ABCD matrix solution and then converted it to S-Parameters.
I then wrote a Matlab Function that takes the three unknowns i.e two inductance values and one capacitance value and gives the circuit response at three frequency points. Now I want to reverse the algorithm i.e I want to have 3 frequency points as input and get L,C values of my circuit as output. Does anybody know how to achieve this?
Here is my MATLAB code:
function out=eqns(in) x=in(1); y=in(2); z=in(3);
%%%%%%%%% Data From Graph %%%%%%%%%%
w=2*pi*[1.860e9 1.869e9 1.889e9]; S12_log=[-23.04 -16.52 -20.38];
%%%%%%%%%%%%% Defined Variables %%%%%%%%%%%
for j=1:3 %%% 3 points=> Corresponding to each iteration; we get an output equation %%% written in the end
Zac(j)=(x/z); %%% Zac=Zac'=Zbc=Zbc' Y(j)=w(j)*y*1i; %%% X(j)=1i*((2*w(j)*x*z)+(w(j)*x^2))/z; %%% X=X' Yc(j)=-1i/(w(j)*z); %%% Yc=Yc'
%%%%%%%%%%%%% ABCD Matrix %%%%%%%%%%%%%%
A(j)=1+Zac(j)+Y(j)*X(j)+Zac(j)+Zac(j)^2+Y(j)*X(j)*Zac(j)+X(j)*Yc(j); B(j)=2*X(j)+X(j)*Zac(j)+Y(j)*X(j)^2+X(j)*Zac(j); C(j)=Yc(j)+Y(j)+Y(j)*Zac(j)+Zac(j)*Yc(j)+Zac(j)*Y(j)+Y(j)*Zac(j)^2+Yc(j)+Zac(j)*Yc(j); D(j)=X(j)*Yc(j)+Y(j)*X(j)+X(j)*Y(j)*Zac(j)+1+2*Zac(j)+Zac(j)^2;
Zo=50;
symm_check(j)=A(j)*D(j)-B(j)*C(j);
%%%%%%% Factor %%%%%%%% magnitude(j)=abs((2*A(j)*Zo)+B(j)+(C(j)*Zo^2));
verf(j)=(2*Zo)/(magnitude(j));
%%%%%%%%%%%% S12=S21 %%%%%%%%%%%%%
%%%%%%%%%% data from Graph %%%%%%%%
S12(j)=10^(S12_log(j)/20);
end
%%%%%%%%%% output Eqs %%%%%%%%%%%
out(1)=S12(1)*magnitude(1)-2*Zo;
out(2)=S12(2)*magnitude(2)-2*Zo;
out(3)=S12(3)*magnitude(3)-2*Zo;
out=out';
20*log10(verf) symm_check;
回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Data Import and Network Parameters についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!