怎么用matlab对传输线的阻抗匹配进行仿真?
以前随手写的,不过有错误(波的原理性错误),需要修改才对
a=1;
b=0;
s=a*exp(j*b/180*pi);
f=2e9;
lemada=4e8/f;
t=0:0.01e-9:4e-9;
z=-1+0.005:0.005:0;
wave_in=zeros(200,401);
wave_re=zeros(200,401);
for n=1:100
temp=2*n;
wave_in(1:temp,n)=exp(j*(2*pi*f*t(n)-2*pi/lemada*z(1:temp)'));
end;
for n=101:401
wave_in(:,n)=exp(j*(2*pi*f*t(n)-2*pi/lemada*z'));
end;
for n=1:100
temp=200-2*n+2;
wave_re(temp:200,100+n)=exp(j*(2*pi*f*t(n)+2*pi/lemada*z(temp:200)'))*s;
end;
for n=201:401
wave_re(:,n)=exp(j*(2*pi*f*t(n)+2*pi/lemada*z'))*s;
end;
wave=wave_in+wave_re;
wave_RE=real(wave);
for k = 1:401
L{k} =real(wave(:,k));
end
% Set graphics parameters.
fig = figure;
set(fig,'color','k')
h = plot(z,L{1},'w');
% [a,e] = view; view(a+270,e);
axis([-1 0 -2 2]);
axis off;
% Buttons
uicontrol('pos',[70 10 60 20],'string','close','fontsize',12, ...
'callback','close(gcbf)');
uicontrol('pos',[130 10 60 20],'string','play','fontsize',12, ...
'callback','set(gcbf,''userdata'',1)');
uicontrol('pos',[190 10 60 20],'string','pause','fontsize',12, ...
'callback','set(gcbf,''userdata'',0)');
uicontrol('pos',[250 10 60 20],'string','reset','fontsize',12, ...
'callback','set(gcbf,''userdata'',2)');
uicontrol('pos',[310 10 60 20],'string','reback','fontsize',12, ...
'callback','set(gcbf,''userdata'',3)');
uicontrol('pos',[370 10 60 20],'string','faster','fontsize',12, ...
'callback','set(gcbf,''userdata'',4)');
uicontrol('pos',[430 10 60 20],'string','slower','fontsize',12, ...
'callback','set(gcbf,''userdata'',5)');
dt = 10000000;
k=1;
m=2;
set(fig,'userdata',m)
% Run
while ishandle(fig)
if get(fig,'userdata')==4
dt=1/2*dt;
set(fig,'userdata',1);
elseif get(fig,'userdata')==5
dt=2*dt;
set(fig,'userdata',1);
end;
i=dt;
while i>0
i=i-1;
end;
if get(fig,'userdata')==1
k=k+1;
elseif get(fig,'userdata')==2
k=1;
elseif get(fig,'userdata')==3
if k>10
k=k-10;
else
k=1;
end;
set(fig,'userdata',0);
end;
if get(fig,'userdata')==2
k=k+1;
end;
if k==402;
k=201;
end;
A =L{k};
% Surface plot of y axis
set(h,'ydata',A);
drawnow
end;
相关文章:
- 传输线的特性阻抗有什么工程意义?? (05-08)
- 一个关于传输线的问题(05-08)
- microstrip 传输线在 RFIC 中的应用?(05-08)
- 请教个传输线测量问题(05-08)
- 频率依赖的传输线是什么意思啊?(05-08)
- 片上传输线用ADS Momentum哪种仿真模式?(05-08)