function [Z,fig_num]=rf_imp_transform(freq, fig_num_in)
%
% this function computes an inpute impedance and plot all
% impedance transformations in the network which is stored
% in the global variable rf_Network.
% Network is analyzed at given frequency specified by
% the input parameter freq.
% Outputs of this routine are input impedance and a figure
% number which contains the Smith Chart with impedance transformations
% if the Smith Chart was specified by fig_num_in, then fig_num=fig_num_in
%
global Z0;
global rf_Network; % initialize a reference to the global variable
%
% Global variable rf_Network contain a description of the network.
% The description of each element in the network contains the following
% five fields stored in rf_Network:
%
% field# | field name | meaning
% --------+--------------+---------------
% 1 | element | describes what element is connected
% | | this field can have the following values
% | | 0 - constant impedance (e.g. resistor)
% | | 1 - inductance
% | | 2 - capacitance
% | | 3 - transmission line
% | | 4 - short-circuit stub
% | | 5 - open-circuit stub
% --------+--------------+---------------
% 2 | value | value of the element
% --------+--------------+---------------
% 3 | shunt/series | 1=shunt or 0=series connection
% --------+--------------+---------------
% 4 | frequency | frequency at which electrical length of the line is specified
% --------+--------------+---------------
% 5 | Z0 | characteristic line impedance
% --------+--------------+---------------
%
NN=size(rf_Network);
Nodes=NN(2); % find out how many elements are in the network
fig_num=-1; % indication that network is empty
Z=inf;
if Nodes==0 % if there are no elements, then just return.
return;
end;
f=freq;
w=2*pi*f;
% find out which element is the first
% it can be either capacitor, or inductor, or impedance, or stub
% there is no check performed for illegal combinations, so it is
% left up to user to worry about the correctness of the description
element=rf_Network(1,1);
value=rf_Network(2,1);
line_Z0=rf_Network(5,1);
shunt=rf_Network(3,1);
frequency=rf_Network(4,1);
if element==0 % constant impedance
if shunt==1 % shunt connection
Z=value;
end;
elseif element==1 % inductor
value=j*w*value;
if shunt==1 % shunt connection
Z=value;
end;
elseif element==2 % capacitor
value=1/(j*w*value);
if shunt==1 % shunt connection
Z=value;
end;
elseif element==4 % sc stub
theta=value*f/frequency*pi/180;
Z_stub=j*line_Z0*tan(theta);
if shunt==1 % shunt connection
Z=Z_stub;
end;
elseif element==5 % oc stub
theta=value*f/frequency*pi/180;
Z_stub=-j*line_Z0/tan(theta);
if shunt==1 % shunt connection
Z=Z_stub;
end;
end;
if nargin>1
fig_num=figure(fig_num_in);
else
fig_num=smith_chart;
end;
hold on;
s_Point(Z);
if Z~=inf % check that the first element was correct,
% i.e., Z was recomputed
for n=2:Nodes % run through all remaining elements in the network
% read in the description of the next component
element=rf_Network(1,n);
value=rf_Network(2,n);
line_Z0=rf_Network(5,n);
shunt=rf_Network(3,n);
frequency=rf_Network(4,n);
if element==0 % constant impedance
% (here it is considered to be just a resistor)
if shunt==1 % shunt connection
G1=real(1/Z);
B=imag(1/Z);
Z=1/(1/Z+1/value);
G2=real(1/Z);
s_ArcB(B,G1,G2);
s_Point(Z);
else % series connection
R1=real(1/Z);
X=imag(1/Z);
Z=Z+value;
R2=real(1/Z);
s_ArcX(X,R1,R2);
s_Point(Z);
end;
elseif element==1 % inductor
value=j*w*value;
if shunt==1 % shunt connection
B1=imag(1/Z);
G=real(1/Z);
Z=1/(1/Z+1/value);
B2=imag(1/Z);
s_ArcG(G,B1,B2);
s_Point(Z);
else % series connection
X1=imag(Z);
RR=real(Z);
Z=Z+value;
X2=imag(Z);
s_ArcR(RR,X1,X2);
s_Point(Z);
end;
elseif element==2 % capacitor
value=1/(j*w*value);
if shunt==1 % shunt connection
B1=imag(1/Z);
G=real(1/Z);
Z=Z*value/(Z+value);
B2=imag(1/Z);
s_ArcG(G,B1,B2);
s_Point(Z);
else % series connection
X1=imag(Z);
RR=real(Z);
Z=Z+value;
X2=imag(Z);
s_ArcR(RR,X1,X2);
s_Point(Z);
end;
elseif element==3 % line
% here we have to take into account that characteristic
% line impedance may be different from Z0 for which
% the Smith Chart is plotted
Gamma0=(Z-line_Z0)/(Z+line_Z0);
Gamma1=(line_Z0-Z0)/(line_Z0+Z0);
theta=value*f/frequency*pi/180;
aa=(0:100)/100*theta;
GG=(Gamma1+Gamma0*exp(-2*j*aa))./(1+Gamma1*Gamma0*exp(-2*j*aa));
hold on;
plot(real(GG), imag(GG), 'b', 'linewidth', 2);
hold off;
Gamma=Gamma0*exp(-2*j*theta);
Z=line_Z0*(1+Gamma)/(1-Gamma);
s_Point(Z);
elseif element==4 % sc stub
theta=value*f/frequency*pi/180;
Z_stub=j*line_Z0*tan(theta);
if shunt==1 % shunt connection
B1=imag(1/Z);
G=real(1/Z);
Z=1/(1/Z+1/Z_stub);
B2=imag(1/Z);
s_ArcG(G,B1,B2);
s_Point(Z);
else % series connection
X1=imag(Z);
RR=real(Z);
Z=Z+Z_stub;
X2=imag(Z);
s_ArcR(RR,X1,X2);
s_Point(Z);
end;
elseif element==5 % oc stub
theta=value*f/frequency*pi/180;
Z_stub=-j*line_Z0/tan(theta);
if shunt==1 % shunt connection
B1=imag(1/Z);
G=real(1/Z);
Z=1/(1/Z+1/Z_stub);
B2=imag(1/Z);
s_ArcG(G,B1,B2);
s_Point(Z);
else % series connection
X1=imag(Z);
RR=real(Z);
Z=Z+Z_stub;
X2=imag(Z);
s_ArcR(RR,X1,X2);
s_Point(Z);
end;
end;
end
end;
hold off;
没有合适的资源?快使用搜索试试~ 我知道了~
Matlab_射频上常用的转换以及分析_S矩阵转化成Z矩阵_放大器稳定性分析
共65个文件
m:65个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 68 浏览量
2022-07-02
00:56:43
上传
评论
收藏 34KB ZIP 举报
温馨提示
Matlab_射频上常用的转换以及分析_S矩阵转化成Z矩阵_放大器稳定性分析
资源推荐
资源详情
资源评论
收起资源包目录
射频上常用的转换以及分析.zip (65个子文件)
射频上常用的转换以及分析
networks
init_network.m 36B
Add_trans_line.m 654B
Add_shunt_inductor.m 322B
rf_imp_transform.m 7KB
Add_shunt_capacitor.m 327B
Add_shunt_sc_stub.m 705B
Add_shunt_impedance.m 457B
Add_series_inductor.m 325B
Add_series_sc_stub.m 701B
find_all_matching.m 3KB
rf_get_impedance.m 4KB
Add_series_impedance.m 451B
find_matching.m 2KB
Add_shunt_oc_stub.m 704B
Add_series_oc_stub.m 700B
Add_series_capacitor.m 332B
smith
s_Point.m 379B
s_Load.m 493B
s_ArcR.m 1KB
pretty_smith.m 3KB
const_G_circle.m 810B
s_ArcG.m 1KB
Set_Z0.m 349B
Set_vp.m 53B
Set_Freq.m 51B
const_SWR_circle.m 763B
const_R_circle.m 804B
smith_chart.m 4KB
s_ArcX.m 1KB
s_ArcB.m 1KB
global
Gamma_out.m 152B
get_lambda.m 89B
MA_to_RI.m 67B
Gamma_in.m 149B
get_betta.m 96B
VSWR.m 204B
circles
noise
nfcircle.m 1000B
gain
const_gain.m 2KB
stability
output_stability.m 1KB
input_stability.m 1KB
quality
Qn_contours.m 804B
conversion
S_to_Y.m 287B
S_to_ABCD.m 287B
Z_to_Y.m 162B
H_to_S.m 280B
Y_to_Z.m 154B
H_to_Z.m 315B
Z_to_S.m 444B
H_to_ABCD.m 310B
ABCD_to_Z.m 360B
Z_to_H.m 151B
S_to_Z.m 285B
Z_to_ABCD.m 310B
ABCD_to_S.m 401B
S_to_H.m 282B
ABCD_to_H.m 192B
T_to_S.m 153B
S_to_T.m 152B
Y_to_H.m 151B
Y_to_ABCD.m 147B
H_to_Y.m 151B
ABCD_to_Y.m 193B
Y_to_S.m 274B
amplifiers
K_factor.m 425B
compl_conj.m 1KB
共 65 条
- 1
资源评论
wouderw
- 粉丝: 269
- 资源: 2960
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功