Professional Documents
Culture Documents
RF Transmission Line Simulation and Design Tool
RF Transmission Line Simulation and Design Tool
BAHEEHR UNIVERSITY
Capstone Project
Saliha Kaykun
STANBUL, 2011
T.C.
BAHEEHR UNIVERSITY
FACULTY OF ENGINEERING
DEPARTMENT OF ELECTRICAL & ELECTRONICS ENGINEERING
Capstone Project
Saliha Kaykun
STANBUL, 2011
T.C.
BAHEEHR UNIVERSITY
FACULTY OF ENGINEERING
DEPARTMENT OF ELECTRICAL & ELECTRONICS ENGINEERING
Name of the project: Rf transmission line simulation and design tool
Name/Last Name of the Student: Saliha Kaykun
Date of Thesis Defense: 20/06/2011
I hereby state that the graduation project prepared by Saliha Kaykun has been
completed under my supervision. I accept this work as a Graduation Project.
20/06/2011
Babur Hadimioglu
I hereby state that I have examined this graduation project by Saliha Kaykun which
is accepted by his supervisor. This work is acceptable as a graduation project and the
student is eligible to take the graduation project examination.
20/06/2011
Asst. Prof. Cigdem Eroglu
We hereby state that we have held the graduation examination of Your Name and
agree that the student has satisfied all requirements.
THE EXAMINATION COMMITTEE
Committee Member
Signature
1. Babur Hadimioglu
..
2. ..
..
3. ..
..
In keeping with Baheehir University Student Code of Conduct, I pledge that this work is
my own and that I have not received inappropriate assistance in its preparation.
I further declare that all resources in print or on the web are explicitly cited.
NAME
DATE
SIGNATURE
ii
ABSTRACT
This paper mentioned about radio frequency transmission line simulation and
design tool. Many graphics and non-graphics based tools have been developed to support
various
areas
of radio
frequency
and
microwave
engineering.
Radio
frequency
transmission line solutions are analyzed by various methods. In this Project, method is
Matlab GUI. This program is used, depending on the users request and to supply graphical
interface. This Project does Matlab GUI in solving the single stub, double stub problems
and solving single stub problems, as well as no matching network case. When the solution
of transmission line problems solving with Matlab GUI, it show Smith Chart and plot the
frequency and magnitude reflection coefficient. The using of Matlab GUI is common at the
market.
Key Words:
iii
ZET
Anahtar Kelimeler:
iv
TABLE OF CONTENTS
ABSTRACT...........................................................................................................................iii
ZET .................................................................................................................................... iv
TABLE OF CONTENTS....................................................................................................... v
LIST OF TABLES ................................................................................................................ vi
LIST OF FIGURES ..............................................................................................................vii
1. INTRODUCTION ............................................................................................................. 1
2. Modeling Transmission Lines............................................................................................ 1
2.1. Transmission Line.................................................................................................. 1
2.2. Matching Network ................................................................................................. 4
2.2.1 Single Stub ...................................................................................................... 5
2.2.1 Double Stub.. ..6
3. Simulation & Design Tool ................................................................................................. 7
4. Conclusion ............................................................................................... 19
APPENDIX A ...................................................................................................................... 20
APPENDIX B ...................................................................................................................... 21
REFERENCES .................................................................................................................... 43
LIST OF TABLES
Table 1.Transmission Line Characteristics ............................................................................ 2
vi
LIST OF FIGURES
Figure 1. Transmission Line .................................................................................................. 2
Figure 2. Load Impedance Formula ...................................................................................... 3
Figure 3. Input Impedance Due to a Line Terminated by a Load .......................................... 3
Figure 4. Matching Network .................................................................................................. 5
Figure 5. Single Shunt and Series Stub Circuited Short and Open........................................ 6
Figure 6. Double Shunt and Series Stub Circuited Short and Open ..................................... 7
Figure 7. Matlab GUI for Solving Transmission Line........................................................... 9
Figure 8. Solution for No Matching Network Case ............................................................... 9
Figure 9. No matching network case .................................................................................... 9
Figure 10. Single Shunt Stub Matlab GUI ........................................................................... 11
Figure 11. Solution 1 for Single Shunt Stub ........................................................................ 12
Figure 12. Solution 2 for Single Shunt Stub ........................................................................ 12
Figure 13. Solution for Single Shunt Stub .......................................................................... 12
Figure 14. Single Series Stub Matlab GUI .......................................................................... 14
Figure 15. Soluiton 1 for Single Series Stub........................................................................ 14
Figure 16. Solution 2 for Single Series Stub....................................................................... 15
Figure 17. Solution for Single Series Stub.......................................................................... 15
Figure 18. Double Shunt Stub Matlab GUI ......................................................................... 17
Figure 19. Solution 1& Solution 2 for Double Shunt Stub ................................................ 17
Figure 20. Solution for Double Shunt Stub ......................................................................... 18
vii
1. INTRODUCTION
This paper introduces radio frequency line simulation and design tool. This goal of
this project is to design a tool for transmission line. Also this project, I choose to use the
wide range of areas such communication and it has an abstract concept. When abstract
concepts changes concrete concepts, it is noteworthy. Transmission line is used for military
industry, communication, aerospace etc. Transmission lines are commonly used in power
distribution (low frequency) and in communications (high frequency).RF transmission
lines are high frequencies so I do not lumped element this project. Transmission line needs
analysis for use in these areas. Transmission line has some formulas. According to the case
and parameters, transmission line operates mathematically. Types of transmission line uses
coaxial line, two-wire line a parallel-plate etc. Particular transmission line uses coaxial
lines.
The
problem of transmission
lines
are
solved
using
circuit
theory
and
Transmission line problems are solved using electromagnetic field theory and electric
circuit theory. The type of transmission lines are coaxial cable, a two-wire line, a parallelplate, a microstrip plane etc. Transmission lines have circuit components. The line
parameters are resistance per unit length R, inductance per unit L, conductance per unit
length G, and capacitance per unit length C.
In this project, transmission lines are solved using parameters. This parameters are speed
(Vp/c), propagation constant ( ), phase constant ( ), length
impedance (
).Cases of transmission line are lossless and low-loss. A case is the low loss
transmission line, where the reactive elements still take over but R and G cannot be
neglected as in a loss-line. 50 ohms is the most commonly used characteristic impedance. I
use the formula of transmission line at figure2.
(Low Loss)
(1)
(Lossless)
(2)
For this formulas becomes showing that the input impedance varies periodically with
distance l from the load. The quantity Bl in usually referred to as the electrical length of
the line and can be expressed in degrees or radians. The reflection coefficient can be given
by the equations below, where Zo is the impedance toward the source; ZL is the impedance
toward the load: [2]
(3)
The standing wave ratio is the measurement of maximum voltage to minimize voltage on a
transmission line and measures the perfection of the termination of the line. A ratio of 1:1
describes a line terminated in its characteristic impedance.
(4)
The Smith Chart (Appendix A) is the most commonly used of graphical techniques in
solving high-frequency transmission line problems. Although there are a number of other
impedance and reflection coefficient chart that can be used for problems, the Smith chart is
probably the best known .The reflection coefficient is displayed graphically using a Smith
Chart. It is basically a graphical indication of the impedance of a transmission line as one
move along the line. The smith chart convert from the reflection coefficients to normalized
impedance and using the impedance circle printed on the chart. The locations of standing
wave ratio along the transmission line can be located using the Smith chart given that these
values correspond to specific impedance characteristics.
Types of matching network are single stub, double stub, triple stub and quarterwave. In this project, I implemented two of matching network and I implemented single
stub and double stub. The transmission line actualizing the stub is normally completed by
an open or by a short. In many cases it is also it is suitable to choose the same
characteristic impedance used for the main line, though this is not necessary. The choice of
open or
shorted stub will be based on practice on factors. A short stub is tents to escape
of electromagnetic radiation. Otherwise, an open stub is more practical than short stub. I
selected to clear open circuited stub or short circuited stub.
Figure 5: Single shunt and series stub circuited short and open
Two adjustable parameters are
The distance, d, from the load to the stub position
Figure 6: Double shunt and series stub circuited short and open
Double stub steps on Smith chart;
Locate the normalized load impedance ,ZL;
The double stub,which uses two tuning stubs in fixed positions,can be used.Such tuners are
often fabricated in coaxial line,with adjustable stubs connected in parallel to the main
coaxial line.Double stub tunner cannot match all load impedances.Shunt stub is
usually
components. Then I write matlab coding m-file (Appendix B). This paper focuses on the
approach used to conduct projects for solving stub transmission line problem with the
Smith Chart using the scripts that were developed by the authors.
Example Program
A 0.0001m-long low-loss transmission line with Zo=50 ohm operating at 2 GHz is
terminated with a load ZL=60-j80 ohm. If Vp/c=0.6c on the line. The process is illustrated
starting with figure 7where complex value of ZL is indicated by the user. Depending upon
the input variables and selections made by user while defining the inputs for the selected
design, the appropriate parameters are calculated and displayed. The first result displayed
in this case figure7 is a plot of reflection coefficient versus frequency for each of the single
stub solutions that are possible. The final results are displayed in the Smith chart such as
figure 8. It is showed start frequency and stop frequency in smith chart by.
Where
Now d is chosen so that G=Yo=1/Zo. From this results is an quadratic equation for t;
To find the required stub lengths, first use t find the stub susceptance, Bs=-B. Then, for an
open-circuited stub,
=
While for a short-circuited stub,
(
10
11
12
Where
Now d is chosen so that R=Zo=1/Yo. From this results is an quadratic equation for t;
To find the required stub lengths, first use t find the stub susceptance, Xs=-X. Then, for an
open-circuited stub,
=
While for a short-circuited stub,
(
13
Smith chart such as figure 15 and figure 16. It is showed start frequency and stop
frequency in smith chart by.
14
Where YL=GL+jBL; is load admittance and B1 is the susteptance of the first stub.After
transforming through a length d of transmission line,admittance just to the right of the
second stub is
15
Where t=tanBd and Yo=1/Zo.At this point,the real part of Y2 must equal Yo,which leads
to the equation
that can be matched for a given stub spacing, d. After d has been ,the first stub susceptance
can be determined from as
Then the second stub substance can be found from the negative of the imaginary part of to
be
The upper and lower signs in correspond to the same solution.the open circuited stub
length is found as
,
16
result displayed in this case figure18 is a plot of reflection coefficient versus frequency for
each of the single stub solutions that are possible. The final results are displayed in the
Smith chart such as figure 19. It is showed start frequency and stop frequency in smith
chart by.
17
18
4. Conclusion
For this project, I learned theorically about transmission line, matching network.
This
theoretical information,
learn
to
make
advantage
19
APPENDIX A
20
APPENDIX B
Matlab M-file Coding(Matlab 2010 b)
function varargout=sonhal(varargin)
close all;
clear all;
clc;
fh = figure('Visible','on','Name','Transmission Line Tools',...
'MenuBar','none',....
'Color',[0.4 0.4 0.5],...
'Position', [520 383 839 417]);
ph= uipanel('Parent',fh,'Title','Transmission Line Parameters',... Transmission Line
parameters
'Units','pixels',....
'Position',[0 241 170 157]);
sth=uicontrol(ph,'Style','text',...
Zo yzeyine static text kutusu
'Units','pixels',....
'String','Zo',....
'Position',[3 121 52 14]);
eth0=uicontrol(ph,'Style','edit',...
Zo yzeyine edit kutusu ekleme
'Units','pixels',....
'BackgroundColor',[1 1 1], ...
'String','50',...
'Position',[59 111 51 22]);
sth0=uicontrol(ph,'Style','text',...
Zo yzeyine static text kutusu
'Units','pixels',...
'String','ohm',...
'Position',[112 110 52 16]);
sth1=uicontrol(ph,'Style','text',... alpha yzeyine static text kutusu
'Units','pixels',....
'String','alpha',...
'Position',[3 88 52 14]);
eth1=uicontrol(ph,'Style','edit',...
alpha yzeyine edit kutusu ekleme
'Units','pixels',...
'BackgroundColor',[1 1 1], ...
'String','0.0002',...
'Position',[59 78 51 22]);
sth11=uicontrol(ph,'Style','text',...alpha yzeyine static text kutusu
'Units','pixels',...
'String','dB/m',...
'Position',[119 83 41 14]);
21
22
23
24
'Position',[195 29 35 15]);
eth7=uicontrol(bgh79,'Style','edit',...
d yzeyine edit kutusu ekleme
'Units','pixels',....
'BackgroundColor',[1 1 1], ...
'String','0.125',...
'Position',[232 24 51 22]);
sth77=uicontrol(bgh79,'Style','text',...
d yzeyine static text kutusu
'Units','pixels',...
'String','lambda',...
'Position',[288 30 44 14]);
bgh35= uibuttongroup(bgh79,'Title','',...
'Units','pixels',...
'Position',[340 10 80 52]);
rbh10 = uicontrol(bgh35,'Style','radiobutton','String','Short',...Short
'Units','pixels',... ekleme
'Position',[4 27 61 23]);
rbh11 = uicontrol(bgh35,'Style','radiobutton','String','Open',... Open
'Units','pixels',... ekleme
'Position',[6 6 60 23]);
ph3= uipanel('Parent',fh,... GUI yzeyine panel ekleme
'Units','pixels',...
'Position',[0 84 201 144]);
sth8=uicontrol(ph3,'Style','text',...fmatches GUI yzeyine static text kutusu
'Units','pixels',...
'String','fmatches',...
'Position',[19 104 52 14]);
eth8=uicontrol(ph3,'Style','edit',... fmatches GUI yzeyine edit kutusu ekleme
'Units','pixels',...
'String','2',...
'BackgroundColor',[1 1 1], ...
'Position',[84 103 51 22]);
sth88=uicontrol(ph3,'Style','text',...fmatches GUI yzeyine static text kutusu
'Units','pixels',...
'String','Ghz',...
'Position',[136 105 52 14]);
sth9=uicontrol(ph3,'Style','text',...fstart GUI yzeyine static text kutusu
'Units','pixels',...
'String','fstart',...
'Position',[17 73 52 14]);
eth9=uicontrol(ph3,'Style','edit',... fstart GUI yzeyine edit kutusu ekleme
'Units','pixels',...
'String','1',...
'BackgroundColor',[1 1 1], ...
'Position',[84 70 51 22]);
sth99=uicontrol(ph3,'Style','text',...fstart GUI yzeyine static text kutusu
'Units','pixels',...
'String','Ghz',...
'Position',[136 72 52 14]);
25
26
phase=0:0.1:2*pi+0.1;
for r=0:0.5:2
z = (r/(r+1) + 1/(r+1)*exp(j*phase));
plot(z,'Linewidth', 1);
hold on;
end
max_phase=[0.93 1.57 1.97];
for x=1:3
k=max_phase(x);
phase=-k:0.01:0;
x=x*0.5;
z=((x+1)/x - 1/x*exp(j*phase))*j+1-j;
plot(z, 'Linewidth', 1);
hold on;
end
for x=-3:-1
k=max_phase(-1*x);
x=x*0.5;
phase=0:0.01:k;
z=((x+1)/x - 1/x*exp(j*phase))*j+1-j;
plot(z, 'Linewidth', 1);
hold on
end
axis('equal');
axis('off');
plot([-1 1],[0 0]);
hold on;
max_phase=[0.85, 0.79, 0.73, 0.69];
c=1;
for r=0.1:0.1:0.4
k=max_phase(c);
phase=pi-k:0.01:pi+k;
z = (r/(r+1) + 1/(r+1)*exp(j*phase));
plot(z,'b');
c=c+1;
hold on;
end
max_phase=[0.2, 0.395, 0.58, 0.76 ];
min_phase=[0.132, 0.265, 0.395, 0.52 ];
for x=1:4
k=max_phase(x);
d=min_phase(x);
phase=-k:0.002:-d;
x=x*0.1;
z=((x+1)/x - 1/x*exp(j*phase))*j+1-j;
plot(z);
hold on;
z=((x+1)/x - 1/x*exp(j*phase))*j+1-j;
27
z2=real(z)-j*imag(z);
plot(z2);
end
title('Smith Chart for Znorm=R+jX');
text(0.39, 0.95,'X=1.5'); %Gives the values of circles on the Chart.
text(0.02,0.95,'X=1');
text(-0.59,0.8,'X=0.5');
text(0.39, -0.95,'X=-1.5');
text(0.02,-0.95,'X=-1');
text(-0.59,-0.8,'X=-0.5');
text(-0.98,0.05,'0');
text(0.02,0.05,'1');
text(-0.32,0.05,'0.5');
text(0.42,0.05,'2');
end
function pbh1_Callback(Object, eventdata, handle_list)
Zo=str2double(get(eth0,'string'));
alpha=str2double(get(eth1,'string'));
lenght=str2double(get(eth2,'string'));
Vp=str2double(get(eth3,'string'));
C=str2double(get(eth4,'string'));
R=str2double(get(eth5,'string'));
L=str2double(get(eth6,'string'));
fmatches=str2double(get(eth8,'string'));
fstart=str2double(get(eth9,'string'));
fstop=str2double(get(eth10,'string'));
numberofpoints=str2double(get(eth11,'string'));
d=str2double(get(eth7,'string'));
Beta1=(2*pi*fmatches*1e9)/(Vp*3e8);
fstep=(fstop-fstart)/(numberofpoints-1);
f=(fstart:fstep:fstop);
w2=2*pi*f ;
w1=2*pi*fmatches;
Beta2=(2*pi.*f*1e9)./(Vp*3e8);
lambda=(2*pi)/Beta1;
gamma=(alpha/8.686)+(j*Beta2);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%
%%%%%%%%%%%%%%%LOAD
IMPEDANCE%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%
impedance=get(rbh1,'value');
switch impedance
case 1
%SERIES
ZL1=(R+(j*w1*L)+(1/(j*w1*C*1e-3))); %%%matching network var
ZL2=(R+(j*w2.*L)+(1./(j*w2.*C*1e-3))); %%%matching network yok
fprintf('%10.4g+ %10.4fi ZLoad \n',real(ZL1),imag(ZL1)); .........ORNEK SADECE
28
case 0
%PARALLEL
ZL1=1/((1/R)+(1/(j*w1*L))+(j*w1*C*1e-3));
%%%matching network yok
ZL2=1./(1/R+(1./(j*w2.*L))+(j*w2.*C*1e-3));
%%%matching network yok
fprintf('%5.4g+ %5.4fi ZLoad \n',real(ZL1),imag(ZL1)); .........ORNEK SADECE
end
Zin1=Zo*(ZL1+(j*Zo*tan(Beta1*lenght)))/(Zo+j*ZL1*tan(Beta1*lenght)); %matching
network yok
Zin2=Zo*(ZL2+Zo.*tanh(gamma*lenght))./(Zo+(ZL2.*tanh(gamma*lenght)));
%matching network varsay
Yin1=1/Zin1;
Yin2=1./Zin2;
Yo=1./Zo;
matching=get(rbh4,'value');
switch matching
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%
% % % %%%% No
MATCHING%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%
case 1
reflection=(Zin2-Zo)./(Zin2+Zo);
SWR=(1+abs(reflection))./(1-abs(reflection));
zL=Zin2./Zo;
fprintf('%d reflection(fstart)\n',abs(reflection(fstart))); .........reflection
plot(f,abs(reflection),'ro--');
legend('solution ',0);
xlabel('f*1e9');
ylabel('|\Gamma|');
smithc;
for n=1:length(Zin2)
plot(real(reflection(n)), imag(reflection(n)),'yellow*');
end;
a=nearest((Zin2(fstart))/Zo);
plot(real(reflection(fstart)), imag(reflection(fstart)),'whiteo','Linewidth',6);
k=text(real(reflection(fstart))+0.02, imag(reflection(fstart))+0.02, ['zin2=', num2str(a)]);
k=text(real(reflection(fstart))+0.15, imag(reflection(fstart))+0.15, ['fstart=',
num2str(fstart)]);
set (k, 'BackgroundColor', 'w');
b=nearest((Zin2(n))/Zo);
plot(real(reflection(n)), imag(reflection(n)),'blacko','Linewidth',6);
e=text(real(reflection(n))+0.02, imag(reflection(n))+0.02, ['zin2=', num2str(b)]);
e=text(real(reflection(n))+0.15, imag(reflection(n))+0.15, ['fstop=', num2str(fstop)]);
set (e, 'BackgroundColor', 'w');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%
% % % %%%%MATCHING
NETWORK%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
29
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%
case 0
sstub=get(rbh31,'value');
switch sstub
case 1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%
% % % %%%%SINGLE STUB%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%
series=get(rbh6,'value');
switch series
%%%%%%%%%%%%%%%%%%%%%%%
% % % % % % % SERIES
% % % % % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
case 1
GL = real(Yin1);
BL = imag(Yin1);
Zin1=1./Yo;
if (GL==Yo),
t1 = -BL./(2*Yo);
t2=t1;
else
t1 = (BL+sqrt(GL.*((Yo-GL).^2+BL.^2)./Yo))./(GL-Yo);
t2 = (BL-sqrt(GL.*((Yo-GL).^2+BL.^2)./Yo))./(GL-Yo);
end
if (t1 >= 0),
D1=lambda./2./pi.*atan(t1);
else
D1=lambda./2./pi.*(pi+atan(t1));
end;
if (t2 >= 0),
D2=lambda./2./pi.*atan(t2);
else
D2=lambda./2./pi.*(pi+atan(t2));
end;
X1 = (GL.^2.*t1-(Yo-BL.*t1).*(BL+Yo.*t1))./(Yo.*(GL.^2+(BL+Yo.*t1).^2));
X2 = (GL.^2.*t2-(Yo-BL.*t2).*(BL+Yo.*t2))./(Yo.*(GL.^2+(BL+Yo.*t2).^2));
singlestub=get(rbh8,'value'); %%%%% Single stub open short hali
switch singlestub
case 0 %%%sghort
L1 =-(lambda./2./pi.*atan(X1./Zin1));
L2 =-(lambda./2./pi.*atan(X2./Zin1));
case 1 %
L1 =lambda./2./pi.*atan(Zin1./X1);
L2 =lambda./2./pi.*atan(Zin1./X2);
end;
30
31
plot(real(reflection3(n)), imag(reflection3(n)),'black*','Linewidth',6);
e=text(real(reflection3(n))+0.02, imag(reflection3(n))+0.02, ['zin2=', num2str(b)]);
e=text(real(reflection3(n))+0.15, imag(reflection3(n))+0.15, ['fstop=', num2str(fstop)]);
set (e, 'BackgroundColor', 'w');
smithc;
for n=1:length(Z2)
plot(real(reflection4(n)), imag(reflection4(n)),'yellow*');
end;
t=nearest((Z2(fstart))/Zo);
plot(real(reflection4(fstart)), imag(reflection4(fstart)),'whiteo','Linewidth',6);
g=text(real(reflection4(fstart))+0.02, imag(reflection4(fstart))+0.02, ['zin2=',
num2str(t)]);
g=text(real(reflection4(fstart))+0.15, imag(reflection4(fstart))+0.15, ['fstart=',
num2str(fstart)]);
set (g, 'BackgroundColor', 'w');
b=nearest((Z2(n))/Zo);
plot(real(reflection4(n)), imag(reflection4(n)),'black*','Linewidth',6);
o=text(real(reflection4(n))+0.06, imag(reflection4(n))+0.06, ['zin2=', num2str(b)]);
o=text(real(reflection4(n))+0.15, imag(reflection4(n))+0.15, ['fstop=', num2str(fstop)]);
set (o, 'BackgroundColor', 'w');
%%%%% %%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%
% % % % % % % PARALLEL %%%%%%%%%%%%%%%%%%%%%%%
% % % % % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
case 0
%Parallel
RL = real(Zin1);
XL = imag(Zin1);
Yin1=1./Zo;
if (RL== Zo),
t1 = -XL./(2*Zo);
t2=t1;
else
t1 = (XL+sqrt(RL.*((Zo-RL).^2+XL.^2)./Zo))./(RL- Zo);
t2 = (XL-sqrt(RL.*((Zo-RL).^2+XL.^2)./Zo))./(RL-Zo);
end;
if (t1 >= 0),
D1 = lambda./2./pi.*atan(t1);
else
D1 =lambda./2./pi.*(pi+atan(t1));
end;
if (t2 >= 0),
D2 = lambda./2./pi.*atan(t2);
else
D2 = lambda./2./pi.*(pi+atan(t2));
end;
B1 = (RL.^2.*t1-(Zo-XL.*t1).*(XL+Zo.*t1))./(Zo.*(RL.^2+(XL+Zo.*t1).^2));
B2 = (RL.^2.*t2-(Zo-XL.*t2).*(XL+Zo.*t2))./(Zo.*(RL.^2+(XL+Zo.*t2).^2));
% fprintf('%d X1\n',B1);
% fprintf('%d X2\n',B2);
32
33
end;
a=nearest((Y1(fstart))/Zo);
plot(real(reflection1(fstart)), imag(reflection1(fstart)),'whiteo','Linewidth',6);
k=text(real(reflection1(fstart))+0.02, imag(reflection1(fstart))+0.02, ['zin2=',
num2str(a)]);
k=text(real(reflection1(fstart))+0.15, imag(reflection1(fstart))+0.15, ['fstart=',
num2str(fstart)]);
set (k, 'BackgroundColor', 'w');
b=nearest((Y1(n))/Zo);
plot(real(reflection1(n)), imag(reflection1(n)),'black*','Linewidth',6);
e=text(real(reflection1(n))+0.02, imag(reflection1(n))+0.02, ['zin2=', num2str(b)]);
e=text(real(reflection1(n))+0.15, imag(reflection1(n))+0.15, ['fstop=', num2str(fstop)]);
set (e, 'BackgroundColor', 'w');
smithc;
for n=1:length(Y2)
plot(real(reflection2(n)), imag(reflection2(n)),'yellow*');
end;
t=nearest((Y2(fstart))/Zo);
plot(real(reflection2(fstart)), imag(reflection2(fstart)),'whiteo','Linewidth',6);
g=text(real(reflection2(fstart))+0.02, imag(reflection2(fstart))+0.02, ['zin2=',
num2str(t)]);
g=text(real(reflection2(fstart))+0.15, imag(reflection2(fstart))+0.15, ['fstart=',
num2str(fstart)]);
set (g, 'BackgroundColor', 'w');
b=nearest((Y2(n))/Zo);
plot(real(reflection2(n)), imag(reflection2(n)),'black*','Linewidth',6);
o=text(real(reflection2(n))+0.06, imag(reflection2(n))+0.06, ['zin2=', num2str(b)]);
o=text(real(reflection2(n))+0.15, imag(reflection2(n))+0.15, ['fstop=', num2str(fstop)]);
set (o, 'BackgroundColor', 'w');
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%
% % % %%%%Double STUB%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% %
case 0
dstub=get(rbh20,'value'); %%%Double Stub %SERIES
switch dstub
case 1 %SERIES
zL = Zin1/Zo;
yL = 1/zL;
rL = real(zL);
xL = imag(zL);
t = tan(2*pi*d);
b = sqrt(rL*(1+t^2)-rL^2*t^2);
X1 = -xL + ((1 + b)/t);
X11 = -xL + ((1-b)/t);
X2 = (b + rL)/(rL*t);
34
35
36
YA11=1./ZA11;
reflection1=(YA1-Zo)./(YA1+Zo);
reflection2=(YA11-Zo)./(YA11+Zo);
SWR1=(1+abs(reflection1))./(1-abs(reflection1));
SWR2=(1+abs(reflection2))./(1-abs(reflection2));
plot(f,abs(reflection1),'k*:',f,abs(reflection2),'rs--');
xlabel('f*1e9');
ylabel('|\Gamma|');
legend('solution 1','solution 2',0);
%%%%% %%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%
% % % % % % % Smith Chart ta Gosterimi
%%%%%%%%%%%%%%%%%%%%%%%
% % % % % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%
smithc;
for n=1:length(YA1)
plot(real(reflection1(n)), imag(reflection1(n)),'yellow*');
end;
a=nearest((YA1(fstart))/Zo);
plot(real(reflection1(fstart)), imag(reflection1(fstart)),'whiteo','Linewidth',6);
k=text(real(reflection1(fstart))+0.02, imag(reflection1(fstart))+0.02, ['zin2=',
num2str(a)]);
k=text(real(reflection1(fstart))+0.15, imag(reflection1(fstart))+0.15, ['fstart=',
num2str(fstart)]);
set (k, 'BackgroundColor', 'w');
b=nearest((YA1(n))/Zo);
plot(real(reflection1(n)), imag(reflection1(n)),'black*','Linewidth',6);
e=text(real(reflection1(n))+0.02, imag(reflection1(n))+0.02, ['zin2=', num2str(b)]);
e=text(real(reflection1(n))+0.15, imag(reflection1(n))+0.15, ['fstop=', num2str(fstop)]);
set (e, 'BackgroundColor', 'w');
zoom;
smithc;
for n=1:length(YA11)
plot(real(reflection2(n)), imag(reflection2(n)),'yellow*');
end;
t=nearest((YA11(fstart))/Zo);
plot(real(reflection2(fstart)), imag(reflection2(fstart)),'whiteo','Linewidth',6);
g=text(real(reflection2(fstart))+0.02, imag(reflection2(fstart))+0.02, ['zin2=',
num2str(t)]);
g=text(real(reflection2(fstart))+0.15, imag(reflection2(fstart))+0.15, ['fstart=',
num2str(fstart)]);
set (g, 'BackgroundColor', 'w');
b=nearest((YA11(n))/Zo);
plot(real(reflection2(n)), imag(reflection2(n)),'black*','Linewidth',6);
o=text(real(reflection2(n))+0.06, imag(reflection2(n))+0.06, ['zin2=', num2str(b)]);
o=text(real(reflection2(n))+0.15, imag(reflection2(n))+0.15, ['fstop=', num2str(fstop)]);
set (o, 'BackgroundColor', 'w');
zoom;
%%%%% %%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%
37
% % % % % % % PARALLEL %%%%%%%%%%%%%%%%%%%%%%%
% % % % % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
case 0
zL = Zin1/Zo;
yL = 1/zL;
gL = real(yL);
bL = imag(yL);
t = tan(2*pi*d);
b = sqrt(gL*(1+t^2)-gL^2*t^2);
B1 = -bL + ((1 + b)/t);
B11 = -bL + ((1-b)/t);
B2 = (b + gL)/(gL*t);
B22 = (-b + gL)/(gL*t);
open=get(rbh43,'value'); %%%Double Stub
switch open
case 1 %D1 OPEN
d1 = atan(B1)/(2*pi) ;
d2 = atan(B11)/(2*pi) ;
if (d2 < 0),
d2 = d2 + 1/2;
end;
if (d1 < 0),
d1 = d1 + 1/2;
end;
Ystub1=j*tan(Beta1*d1*lambda);
Ystub11=j*tan(Beta1*d2*lambda);
Y1=yL+Ystub1;
Y11=yL+Ystub11;
open2=get(rbh11,'value'); %%%Double Stub
switch open2
case 1
%D2 OPEN
d11 = atan(B2)/(2*pi) ;
d22= atan(B22)/(2*pi) ;
if (d22 < 0),
d22= d22 + 1/2;
end;
if (d11 < 0),
d11= d11 + 1/2;
end
Y2=(Y1+j*tan(Beta1*d*lambda))/(1+j*Y1*tan(Beta1*d*lambda));
Y22=(Y11+j*tan(Beta1*d*lambda))/(1+j*Y11*tan(Beta1*d*lambda));
YA1 = Y2+j*tan(Beta2.*d11*lambda);
YA11 = Y22+j*tan(Beta2.*d22*lambda);
case 0 % D2 SHORT
d11 =-atan(1./B2)./(2*pi) ;
d22 =-atan(1./B22)./(2*pi) ;
if (d22 < 0),
d22= d22 + 1/2;
38
end
if (d11 < 0),
d11= d11 + 1/2;
end
Y2=(Y1+j*tan(Beta1*d*lambda))/(1+j*Y1*tan(Beta1*d*lambda));
Y22=(Y11+j*tan(Beta1*d*lambda))/(1+j*Y11*tan(Beta1*d*lambda));
YA1 = Y2-j*cot(Beta2.*d11*lambda);
YA11 = Y22 -j*cot(Beta2.*d22*lambda);
end
case 0 % D1 SHORT
d1 = -atan(1./B1)./(2*pi) ;
d2 =-atan(1./B11)./(2*pi) ;
if (d2 < 0),
d2 = d2 + 1/2;
end;
if (d1 < 0),
d1 = d1 + 1/2;
end;
Ystub1=-j*cot(Beta1*d1*lambda);
Ystub2=-j*cot(Beta1*d2*lambda);
Y1=yL+Ystub1;
Y11=yL+Ystub2;
open2=get(rbh11,'value'); %%%Double Stub
switch open2
case 1
%D2 OPEN
d11 = atan(B2)./(2*pi) ;
d22= atan(B22)./(2*pi) ;
if (d22 < 0),
d22= d22 + 1/2;
end;
if (d11 < 0),
d11= d11 + 1/2;
end;
Y2=(Y1+j*tan(Beta1*d*lambda))/(1+j*Y1*tan(Beta1*d*lambda));
Y22=(Y11+j*tan(Beta1*d*lambda))/(1+j*Y11*tan(Beta1*d*lambda));
YA1 = Y2+j*tan(Beta2.*d11*lambda);
YA11 = Y22+j*tan(Beta2.*d22*lambda);
case 0 % D2 Short
d11 =-atan(1./B2)./(2*pi) ;
d22 =-atan(1./B22)./(2*pi) ;
if (d22 < 0),
d22= d22 + 1/2;
end;
if (d11 < 0),
d11= d11 + 1/2;
end;
Y2=(Y1+j*tan(Beta1*d*lambda))/(1+j*Y1*tan(Beta1*d*lambda));
Y22=(Y11+j*tan(Beta1*d*lambda))/(1+j*Y11*tan(Beta1*d*lambda));
39
YA1 = Y2-j*cot(Beta2.*d11*lambda);
YA11 = Y22-j*cot(Beta2.*d22*lambda);
end
end
fprintf('%d d1Solution 1 \n',d1);
fprintf('%dd11 Solution 1 \n',d11);
fprintf('%d d2 Solution 2\n',d2);
fprintf('%d d22 Solution 2 \n',d22);
ZA1=1./YA1;
ZA11=1./YA11;
reflection1=(ZA1-Zo)./(ZA1+Zo);
reflection2=(ZA11-Zo)./(ZA11+Zo);
SWR1=(1+abs(reflection1))./(1-abs(reflection1));
SWR2=(1+abs(reflection2))./(1-abs(reflection2));
plot(f,abs(reflection1),'k*:',f,abs(reflection2),'rs--');
xlabel('f*1e9');
ylabel('|\Gamma|');
legend('solution 1','solution 2',0);
%%%%% %%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%
% % % % % % % PARALLELin SONU
%%%%%%%%%%%%%%%%%%%%%%%
% % % % % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
smithc;
for n=1:length(ZA1)
plot(real(reflection1(n)), imag(reflection1(n)),'yellow*');
end;
a=nearest((ZA1(fstart))/Zo);
plot(real(reflection1(fstart)), imag(reflection1(fstart)),'whiteo','Linewidth',6);
k=text(real(reflection1(fstart))+0.02, imag(reflection1(fstart))+0.02, ['zin2=',
num2str(a)]);
k=text(real(reflection1(fstart))+0.15, imag(reflection1(fstart))+0.15, ['fstart=',
num2str(fstart)]);
set (k, 'BackgroundColor', 'w');
b=nearest((ZA1(n))/Zo);
plot(real(reflection1(n)), imag(reflection1(n)),'black*','Linewidth',6);
e=text(real(reflection1(n))+0.02, imag(reflection1(n))+0.02, ['zin2=', num2str(b)]);
e=text(real(reflection1(n))+0.15, imag(reflection1(n))+0.15, ['fstop=', num2str(fstop)]);
set (e, 'BackgroundColor', 'w');
zoom;
smithc;
for n=1:length(ZA11)
plot(real(reflection2(n)), imag(reflection2(n)),'yellow*');
end;
t=nearest((ZA11(fstart))/Zo);
plot(real(reflection2(fstart)), imag(reflection2(fstart)),'whiteo','Linewidth',6);
g=text(real(reflection2(fstart))+0.02, imag(reflection2(fstart))+0.02, ['zin2=',
num2str(t)]);
40
41
42
REFERENCES
1. Introduction to wave propagation, transmission lines and antennas, NAVAL
EDUCATION AND TRAINING PROFESSIONAL DEVELOPMENT AND
TECHNOLOGY CENTER CONTENTS, 1998
2. http://en.wikipedia.org/wiki/Reflection_coefficient(27.05.2011)
3. Fundamentals of Engineering Electromagnetics, Rajeev Bansal , 2006
4. Microwave Engineering ,David M. Pozar, third edition,2005
5. Graphics and GUIs with MATLAB, Patrick Marchand and O. Thomas,third
edition,2003
43