📄 s_plus_match_2.asv
字号:
% This script takes the transistor s parameters that were measured with the HP 8505a
% and adds the two LC matching networks where the values were previously
% computed and saved to a file.
% To check the design, the voltage transfer function will be computed.
% There are several ways to solve this, but here we will start by
% transforming the s parameter two port network description to an ABCD two port (chain matrix) description.
% Then, the LC matching netorks will be added to ech end of the transistor
% two port networks in ABCD form.
% The advantage of using the chain matrix approach is that matrix
% multiplication gives the desired solution. The alternative would be to
% stay in s paramter form and solve the overall signal flowgraph.
clc
clear
% define some symbolic variables:
syms Zo s11 s12 s21 s22
% Unable to locate an accurate s to ABCD transform, so transform from
% s to z parameters as a first step.
z11 = Zo*((1+s11)*(1-s22)+s12*s21)/((1-s11)*(1-s22)-s12*s21);
z22 = Zo*((1+s22)*(1-s11)+s12*s21)/((1-s22)*(1-s11)-s12*s21);
z12 = Zo*2*s12/((1-s11)*(1-s22)-s12*s21);
z21 = Zo*2*s21/((1-s11)*(1-s22)-s12*s21);
% then transform from z to ABCD ... call it the F
Dz = simple(z11*z22-z12*z21);
Fa(1,1) = simple(z11/z21); % A
Fa(1,2) = simple(Dz/z21); % B
Fa(2,1) = simple(1/z21); % C
Fa(2,2) = simple(z22/z21); % D
Fa % there is nothing "simple" about this, it is a mess !
% no wonder text books do not cover S <-> ABCD
% With that out of the way, define input output matching network
syms x y Z Y s L1 L2 C1 C2 Rl w
Z(1,1) = 1; Z(1,2) = x; Z(2,1) = 0; Z(2,2)=1; % series impedance chain matrix
Y(1,1) = 1; Y(1,2) = 0; Y(2,1) = y; Y(2,2)=1; % shunt admittance chain matrix
% Build a network , same matching network topology just *happens* to be used on transistor input and output
Z(1,2) = L2*s; % series L2
Y(2,1) = C2*s; % shunt C2
N = Z*Y; % combine (series 1st)
Z(1,2) = L1*s + 1/(C1*s); % series lC
N = N*Z; % series L2, shunt C2, followed by series L1 C1
% N is now the symbolic matching network.
load amp_data; % pick up LC values for matching networks
% start at load end of circuit and terminate with a shunt conductance
Y(2,1) = 1/50; % termination
Nout = Y;
% add output matching network
Nout = subs(N, {L1 L2 C1 C2}, {L1o L2o C1o C2o})*Nout;
Y(2,1) = Coo*s; % then a capacitor
Nout = simple(Y*Nout);
% input match network
Ninput = subs(N, {L1 L2 C1 C2}, {(L1i+Loi) L2i C1i C2i});
% input resistor ...
Z(1,2) = 50;
Ninput = Z*Ninput;
% load transistor s parameter data over a range of frequencies
fmin = 15; % MHz
fmax = 1000; % "
df = 10; % "
[stx,f] = s_extract('mrf904_10_10a.rfa',fmin,fmax,df); % get measured s parameter data for mrf904
k=1;
for k=1:length(f)
jw=j*2*pi*f(k)*1e6;
% Transform the S parameter transistor data to a chain m
Ntr = double(subs(Fa, {s11 s12 s21 s22 Zo}, {stx(1,1).s(k), stx(1,2).s(k), stx(2,1).s(k), stx(2,2).s(k) 50} ));
Nall = double(subs(Ninput,s,jw))*Ntr*double(subs(Nout,s,jw));
H(k) = 2/Nall(1,1); % the inverse of the "A" term is the overall voltage xfer function,
% need 2 for the -6dB loss (a 0 dB gain amp has a 2:1 loss)
end;
figure
plot(f,20*log10(abs(H))); grid on;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -