You are on page 1of 11

MICROWAVE ENGINEERING – POZAR – IMPEDANCE MATCHING CHAPTER 05 EXERCISE 09 23/09/2018 11:03:09.

5.9 Double-stub match. TL length between open circuit stubs is /8. YL=Y0*(.4+1j*1.2)
Script source pozar_05_exercise_09.m file and all necessary support functions included in .zip file pozar_05_exercise_09.zip

pozar_05_exercise_09.m

Analytic solution with a surface

abs(s11) resolution dx dy both at 0.001


Z0=50;ZL=Z0/(.4+1j*1.2);D3=1/8;
Dstep=.001;drange=[0:Dstep:1];
D1=drange;D2=D1;
Zin4=zeros(numel(drange),numel(drange));
s11=zeros(numel(drange),numel(drange));

for k=1:1:numel(D1)
for s=1:1:numel(D2)
Zin_stub1=Z0./(1j*tan(2*pi*D1(k)));
Zin2=(Zin_stub1.^-1+ZL.^-1).^-1;
Zin3=Z0*(Zin2+1j*Z0*tan(2*pi*D3))./(Z0+1j*Zin2*tan(2*pi*D3));
Zin_stub2=Z0./(1j*tan(2*pi*D2(s)));
Zin4(k,s)=(Zin_stub2.^-1+Zin3.^-1).^-1;
s11(k,s)=(Zin4(k,s)-Z0)/(Zin4(k,s)+Z0);
end
end

abs(s11);

hf1=figure(1);hs1=surf(D1,D2,abs(s11))
ax1=hf1.CurrentAxes;ax1_backup=ax1
hs1.LineStyle='none'
xlabel('D2');ylabel('D1')

campos([.5 .5 9.1602])
ax1.PlotBoxAspectRatio=[1 1 1]
hold(ax1,'on')
n0=find(drange==.5) % plotting corner to box D1<.5 D2<.5
plot3(ax1,[drange(n0) drange(n0) 0],…
[0 drange(n0) drange(n0)],[5 5 5],'Color',[1 0 0],'LineWidth',3)

_________________________________________________________________________________________________________________________
John Bofarull Guix jgb2012@sky.com 1 / 11
MICROWAVE ENGINEERING – POZAR – IMPEDANCE MATCHING CHAPTER 05 EXERCISE 09 23/09/2018 11:03:09.

Conditioning surface to capture peaks, sharper than just 1./abs(s11)

V=1e3*del2(abs(s11));

hf2=figure(2);ax2=gca;surf(V,'Lines','none');xlabel('D1');ylabel('D2');
ax2.XTickLabelMode='manual';

ax2.XTickLabel=[0:0.1:1];ax2.YTickLabel=[0:0.1:1];
ax2.XTick=[0:100:1000];ax2.YTick=[0:100:1000];

[pks,locs]=findpeaks(V(:),'MinPeakHeight',9,'MinPeakDistance',200);

[nd1,nd2]=ind2sub(size(V),locs);
hold all;plot3(nd2,nd1,V(nd2,nd1)+2,'ro'); % verifying peaks locations

plot3(ax2,[drange(n0) drange(n0) 0],…


0[0 drange(n0) drange(n0)],[5 5 5],'Color',[1 0 0],'LineWidth',3)

=
D1=unique(sort(D1(nd1))) Columns 1 through 3
0.086000000000000 0.375000000000000 0.586000000000000
Column 4
0.875000000000000
D2=unique(sort(D2(nd2))) =
Columns 1 through 3
0.199000000000000 0.375000000000000 0.699000000000000
abs(s11(sub2ind(size(V),nd1,nd2))) % |s11| linear values Column 4
0.875000000000000
D_surf=[D1;D2]
D_surf =
taking only stub lengths below lambda/2 0.0860000 0.3750000 0.5860000 0.8750000
0.1990000 0.3750000 0.6990000 0.8750000
D_surf=D_surf([1 2],[1 2])
D_surf =
D11*360 0.086000000000000 0.375000000000000
D12*360 0.199000000000000 0.375000000000000
= 1.350019397711374e+02
= 30.957734133059738

findpeaks options minpeakheigh and mineapkdist = 8 =


manually trimmed to avoid getting too many peaks = 0.006499310969800
15.367723269270918 0.006499310969799
numel(nd1) 15.367723269272101 0.000000000000001
V(sub2ind(size(V),nd1,nd2)) 10.995122045537965 0.000000000000001
10.995122045537279 0.006499310969801
the |s11| linear values onmatch points: 15.367723269270671 0.006499310969800
15.367723269271853 0.000000000000001
10.995122045537727 0.000000000000001
abs(s11(sub2ind(size(V),nd1,nd2)))
10.995122045537039

1st solution, stubs with lengths below 0.5:


D11=0.086
D12=0.375

2nd solution
D21=0.199
D22=0.375

Not mentioned in the solutions manual, but choosing the


shortest stubs doesn't mean stubs longer than lambda/2
are not perfectly valid.

One can manually change the view point with the rotate
button on the figure window toolbar:

_________________________________________________________________________________________________________________________
John Bofarull Guix jgb2012@sky.com 2 / 11
MICROWAVE ENGINEERING – POZAR – IMPEDANCE MATCHING CHAPTER 05 EXERCISE 09 23/09/2018 11:03:09.

Why matrix only expressions not used

The direct assault, without double for loops, with


current platform, imposes a drastic reduction in the
D1 D2 resolution steps, both up to 0.01, and it takes
about 10 fold more time to produce result than with
the double for.

Dstep=.01;drange=[0:Dstep:1];
[D1,D2]=meshgrid(drange,drange);
Zin_stub1=Z0./(1j*tan(2*pi*D1));
Zin2=(Zin_stub1.^-1+ZL^-1).^-1;
zin3=Z0*(Zin2+1j*Z0*tan(2*pi*D3))./…
(Z0+1j*Zin2*tan(2*pi*D3));
Zin_stub2=Z0./(1j*tan(2*pi*D2));
[Zin_stub2,Zin3]=meshgrid(zin_stub2,zin3);
Zin4=((Zin_stub2.^-1.+Zin3.^-1).^-1);
s11=(Zin4-Z0)./(Zin4+Z0);

When attempting even a modest d=0.001 without double for loop a Error using repmat
serious RAM shortage takes place: Requested 1002001x10001 (149.3GB) array exceeds maximum array size
preference. Creation of arrays greater than this limit may take a
long time and cause MATLAB to become unresponsive. See array size
and d=0.0001 limit or preference panel for more information.
Error in meshgrid (line 58)
Apparently 'smart' compact nice looking expressions sometimes require xx = repmat(xrow,size(ycol));
more processing capacity than equivalent vectorised expressions.
Error using repmat
'Looking smart' goes after 'being smart' not the other way round. Requested 100020001x10001 (14905.6GB) array exceeds maximum array
size preference …

_________________________________________________________________________________________________________________________
John Bofarull Guix jgb2012@sky.com 3 / 11
MICROWAVE ENGINEERING – POZAR – IMPEDANCE MATCHING CHAPTER 05 EXERCISE 09 23/09/2018 11:03:09.

With Smith Chart

1st OC stub, next to load, 1st shortest length:

Z0=50;ZL=Z0/(.4+1j*1.2);
hf3=figure(3);sm3=smithchart; ax3=hf3.CurrentAxes;hold(ax3,'on')

gammaZL=(ZL-Z0)/(ZL+Z0); % mark ZL
[gammaZL_angle,gammaZL_mod]=cart2pol(real(gammaZL),imag(gammaZL))
hold all;plot(real(gammaZL),imag(gammaZL),'ro','LineWidth',1.5);
YL=1/ZL;

gammaYL=(YL-1/Z0)/(YL+1/Z0); % mark YL, no need to switch to Y Smith chart


[gammaYL_angle,gammaYL_mod]=cart2pol(real(gammaYL),imag(gammaYL))
plot(real(gammaYL),imag(gammaYL),'go','LineWidth',1.5);

D3=1/8; % stretch of TL between stubs

1st shunt stub circle


[xc1,yc1]=Smith_plotStubCircle(ax,1/Z0,D3,[0 1 1]);
[x_r1,y_r1]=Smith_plotRcircle(ax,Z0^2/ZL,Z0,[1 0.5 .5]);

[px1,py1]=intersections(xc1,yc1,x_r1,y_r1); % constant R circle for YL


plot(px1,py1,'bo');

Left hand side of YL 1st intersection:

gammaY11=px1(1)+1j*py1(1) gammaY11 = -0.399969149078284 + 0.200061529810982i


gammaY12 = 0.461478371609742 + 0.692294433963756i
reverse reflection coeff to admittance

gammaZ11=-gammaY11
z11=(1-gammaZ11)/(1+gammaZ11)
y11=1/z11
Y11=y11/Z0

[x_Barc_stub11_1,y_Barc_stub11_1]=Smith_plotBarc(ax3,YL,1/Z0,[1 0 0])
[x_Barc_stub11_2,y_Barc_stub11_2]=Smith_plotBarc(ax3,1/Y11,Z0,[1 0 0])

[dX11,arcSC_stub11]=Smith_arcStub(ax3,gammaYL,gammaY11,Z0,1,[0 0 1])

y11_stub1=-1j*dX11/Z0
D11=atan(y11_stub1/1j)/(2*pi)
if D11<0 D11=D11+.5; end

D11

D11*360 D11 = 0.375005388253159

=
1.350019397711374e+02

_________________________________________________________________________________________________________________________
John Bofarull Guix jgb2012@sky.com 4 / 11
MICROWAVE ENGINEERING – POZAR – IMPEDANCE MATCHING CHAPTER 05 EXERCISE 09 23/09/2018 11:03:09.

1st OC stub, 2nd shortest length:

hf4=figure(4);sm4=smithchart;
ax4=hf4.CurrentAxes
hold(ax4,'on')

plot(ax4,real(gammaZL),imag(gammaZL),'ro','LineWidth',1.5);
plot(ax4,real(gammaYL),imag(gammaYL),'go','LineWidth',1.5);
[xc1,yc1]=Smith_plotStubCircle(ax4,1/Z0,D3,[0 1 1]);

plot constant r=1 circle shifted /8 towards generator on Y Smith chart 180deg shifted

[x_r1,y_r1]=Smith_plotRcircle(ax4,Z0^2/ZL,Z0,[1 0.5 .5]);

plot(ax4,px1,py1,'bo');

1st intersection 2nd point, on Smith chart right hand side to YL, shunt stub has to shift
impedance YL to Y12 CW, d=1

gammaY12=px1(2)+1j*py1(2)
gammaZ12=-gammaY12

from reflection coeff to admittance

z12=(1-gammaZ12)/(1+gammaZ12)
y12=1/z12;Y12=y12/Z0
[x_Barc_stub12_1,y_Barc_stub12_1]=Smith_plotBarc(ax4,YL,1/Z0,[1 0 0])
[x_Barc_stub12_2,y_Barc_stub12_2]=Smith_plotBarc(ax4,1/Y12,Z0,[1 0 0])
[dX12,arcSC_stub12]=Smith_arcStub(ax4,gammaYL,gammaY12,Z0,-1,[0 0 1])
y12_stub1=1j*dX12/Z0
D12=atan(y12_stub1/1j)/(2*pi)
if D12<0 D12=D12+.5; end
D12 D12 = 0.08599370592516
ADS by default supplies stub length results in degree
= 30.957734133059738
D12*360

2nd OC stub, 1st shortest length:

hf5=figure(5);sm5=smithchart;
ax5=hf5.CurrentAxes
hold(ax5,'on')

plot(ax5,real(gammaZL),imag(gammaZL),'ro','LineWidth',1.5);
plot(ax5,real(gammaYL),imag(gammaYL),'go','LineWidth',1.5);
plot(ax5,px1,py1,'o','Color',[.6 .6 1]); % intersection points for 1st stub
Smith_plotStubCircle(ax5,1/Z0,D3,[.7 1 1]);
% r=1 circle rotated lambda/8 away from generator Y Smith chart

D3_TLshift=pi/4 % TL shift lambda/8 in rad


a1=-2*D3_TLshift % D3 shift on Smith chart, towards generator on Y Smith chart

rotation matrix

G=[cos(a1) -sin(a1);sin(a1) cos(a1)];

Y11=y11/Z0;Y12=y12/Z0;
[x_GCz21,y_GCz21]=Smith_plotGammaCircle(ax5,1/Y11,Z0,[1 .8 .8]);
[x_GCz22,y_GCz22]=Smith_plotGammaCircle(ax5,1/Y12,Z0,[1 .8 .8]);

constant resistance circle g=re(YL)

[x_r1,y_r1]=Smith_plotRcircle(ax5,Z0^2/ZL,Z0,[1 0.5 .5]);

Pc2=G*[xc1;yc1] % rotating stub circle


xc2=Pc2(1,:);yc2=Pc2(2,:);
plot(ax5,xc2,yc2,'c') % circle r=1

P2=G*[px1';py1'] % rotating intersection points


px2=P2(1,:);py2=P2(2,:); D21 = 0.374993889549368
plot(ax5,px2,py2,'bo') % intersection points on r=1 circle

gammaY21=px2(1)+1j*py2(1)

gammaZ21=-gammaY21 % from reflection coeff to admittance


z21=(1-gammaZ21)/(1+gammaZ21)
Z21=z21*Z0
y21=1/z21
Y21=y21/Z0

[x_Barc_stub21,y_Barc_stub21]=Smith_plotBarc(ax5,1/Y21,Z0,[1 0 0])
[x_Barc_stub22,y_Barc_stub22]=Smith_plotBarc(ax5,0,Z0,[1 0 0])

[dX21,arcSC_stub21]=Smith_arcStub(ax5,-1,gammaY21,Z0,-1,[0 0 1])
y21_stub2=-1j*dX21/Z0 % -1 quick fix, pending more robust fix
D21=atan(y21_stub2/1j)/(2*pi)
if D21<0 D21=D21+.5; end; D21

_________________________________________________________________________________________________________________________
John Bofarull Guix jgb2012@sky.com 5 / 11
MICROWAVE ENGINEERING – POZAR – IMPEDANCE MATCHING CHAPTER 05 EXERCISE 09 23/09/2018 11:03:09.

hf6=figure(6);sm6=smithchart;
ax6=hf6.CurrentAxes
hold(ax6,'on')

plot(ax6,real(gammaZL),imag(gammaZL),'ro','LineWidth',1.5);
plot(ax6,real(gammaYL),imag(gammaYL),'go','LineWidth',1.5);
plot(ax6,px1,py1,'o','Color',[.6 .6 1]);
Smith_plotStubCircle(ax6,1/Z0,D3,[.7 1 1]);

[x_GCz21,y_GCz21]=Smith_plotGammaCircle(ax6,1/Y11,Z0,[1 .8 .8]);
[x_GCz22,y_GCz22]=Smith_plotGammaCircle(ax6,1/Y12,Z0,[1 .8 .8]);

[x_r1,y_r1]=Smith_plotRcircle(ax6,Z0^2/ZL,Z0,[1 0.5 .5]);


% constant resistance circle g=re(YL)

plot(ax6,xc2,yc2,'c') % r=1 circle

plot(ax6,px2,py2,'bo') % intersection points on r=1 circle

gammaY22=px2(2)+1j*py2(2)

gammaZ22=-gammaY22
z22=(1-gammaZ22)/(1+gammaZ22)
Z22=z22*Z0
y22=1/z22
Y22=y22/Z0
[x_Barc_stub12_2,y_Barc_stub12_2]=Smith_plotBarc(ax6,1/Y22,Z0,[1 0 0])
[x_Barc_stub12_2,y_Barc_stub12_2]=Smith_plotBarc(ax6,Z0,Z0,[1 0 0])
[dX22,arcSC_stub22]=Smith_arcStub(ax6,-1,gammaY22,Z0,1,[0 0 1])

y22_stub2=1j*dX22/Z0
D22=atan(y22_stub2/1j)/(2*pi)
if D22<0 D22=D22+.5; end

D22 D22 = 0.198792933210378

D22*360 = 71.565455955736013

Frequency response

c0=2.998e8;f0=2e9;
df=1e6;f1=1e9;f2=3e9;f=[f1:df:f2];D_11=drange;

Putting all stub lengths together in same matrix


D = 0.375005388253159 0.085993705925166
D=[D11 D12;D21 D22]
0.374993889549368 0.198792933210378
a1=atan(D11/D21)
= 0.785413495017266
a1*180/pi
= 45.000878437108625
close(hf1)
D1=drange;D2=D1;
hf1=figure(1);hs1=surf(D1,D2,abs(s11))
ax1=hf1.CurrentAxes;ax1_backup=ax1
hs1.LineStyle='none'
xlabel('D2');ylabel('D1')
ax1.PlotBoxAspectRatio=[1 1 1]
hold(ax1,'on')
plot3(ax1,[drange(n0) drange(n0) 0],[0 drange(n0) drange(n0)],…
[1 1 1],'Color',[1 0 0],'LineWidth',3)

check what way cross sections should go.

plot3(ax1,[0 3*D21],[0 3*D11],[1 1],'-r','LineWidth',1.5)


plot3(ax1,[0 5*D22],[0 5*D12],[1 1],'-r','LineWidth',1.5)

plot3 pushes camera position away, but only for certain data, just to avoid the
resulting view point being left in the middle of the data. The following 2 lines
restore cam pos to bird eye position used at the beginning of this script.

campos(ax1,10*[0 0 100]);
camroll(ax1,-45) % input angle in degree

_________________________________________________________________________________________________________________________
John Bofarull Guix jgb2012@sky.com 6 / 11
MICROWAVE ENGINEERING – POZAR – IMPEDANCE MATCHING CHAPTER 05 EXERCISE 09 23/09/2018 11:03:09.

a1=atan(D11/D21) = 0.785413495017266
a1*180/pi = 45.000878437108625

if a1>pi/4
p=[1 floor(numel(drange)*D21/D11);1 numel(drange)]; end
if a1<pi/4
p=[1 numel(drange);1 floor(numel(drange)*D11/D21)]; end
if a1==pi/4 p=ones(2); end
p=p';
ny1=floor(linspace(p(1,1),p(2,1),max(abs(p(1,1)-p(2,1))+1,…
abs(p(1,2)-p(2,2))+1)));
nx1=floor(linspace(p(1,2),p(2,2),max(abs(p(1,1)-p(2,1))+1,…
abs(p(1,2)-p(2,2))+1)));

abs_S11=abs(s11);

abs_S11_xsection1=[]
for k=1:1:numel(nx1)
abs_S11_xsection1=[abs_S11_xsection1
abs_S11(nx1(k),ny1(k))];
end

hf201=figure(201);
subplot(2,1,1);plot(D_11(ny1),abs_S11_xsection1);grid
on;xlabel('D2')
subplot(2,1,2);plot(D_11(nx1),abs_S11_xsection1);grid
on;xlabel('D1')

a2=atan(D12/D22)
a2*180/pi
= 0.408272819072597
if a2>pi/4 p=[1 floor(numel(drange)*D22/D12);1
= 23.392309422768086
numel(drange)]; end
if a2<pi/4 p=[1 numel(drange);1
floor(numel(drange)*D12/D22)]; end
if a2==pi/4 p=ones(2); end
p=p';
ny2=floor(linspace(p(1,1),p(2,1),max(abs(p(1,1)-…
p(2,1))+1,abs(p(1,2)-p(2,2))+1)));
nx2=floor(linspace(p(1,2),p(2,2),max(abs(p(1,1)-
p(2,1))+1,abs(p(1,2)-p(2,2))+1)));

abs_S11_xsection2=[]
for k=1:1:numel(nx1)
abs_S11_xsection2=[abs_S11_xsection2
abs_S11(nx2(k),ny2(k))];
end

hf202=figure(202);
subplot(2,1,1);plot(D_11(ny2),abs_S11_xsection2);grid
on;xlabel('D2')
subplot(2,1,2);plot(D_11(nx2),abs_S11_xsection2);grid
on;xlabel('D1')

_________________________________________________________________________________________________________________________
John Bofarull Guix jgb2012@sky.com 7 / 11
MICROWAVE ENGINEERING – POZAR – IMPEDANCE MATCHING CHAPTER 05 EXERCISE 09 23/09/2018 11:03:09.

with ADS TL1 length D3=1/8 and D1=135º D2=135º

Spot on, no need to start the tuner.

now looking for another solution, how does the start impedance look, for
manual tuning, with D1=135º D2=108º, now there would be need for
some time manually tuning

Same if starting with D1=D2=108º

_________________________________________________________________________________________________________________________
John Bofarull Guix jgb2012@sky.com 8 / 11
MICROWAVE ENGINEERING – POZAR – IMPEDANCE MATCHING CHAPTER 05 EXERCISE 09 23/09/2018 11:03:09.

shortening TL1, now with D3=1/16=22º (D3 length of TL1 between stubs) and D1=135º D2=31º

there would be need for manual tuning yet

the calculated lengths D11 D212

but after some manual tuning, for D1=122º D2=338º (D3=22º),


impedance match achieved

the ADS tuner, besides verification of MATLAB calculations, offers the versatility to plug in different values than the ones obtained with
the theoretical calculations, and find additional solutions. D3=22.5º manual tuning additional solution D1=81.17º D2=70.42º attempting to obtain
additional matching networks than the ones obtained with POZAR classic approach would be time consuming at least MATLAB coding.

_________________________________________________________________________________________________________________________
John Bofarull Guix jgb2012@sky.com 9 / 11
MICROWAVE ENGINEERING – POZAR – IMPEDANCE MATCHING CHAPTER 05 EXERCISE 09 23/09/2018 11:03:09.

POZAR chosen value of TL between stubs to simplify the calculations D3=/8 gets both stubs really close each other. Perhaps D3=/4 would be more
convenient. Now the lengths of the stubs are closer to the initial calculation.

instead of manually searching as one would do on hardware tuning, the ADS Optimiser may be handy to save
some time, despite is not a shoot-and-forget tool, and for some specific cases it may simply not find where there's
to be found.

_________________________________________________________________________________________________________________________
John Bofarull Guix jgb2012@sky.com 10 / 11
MICROWAVE ENGINEERING – POZAR – IMPEDANCE MATCHING CHAPTER 05 EXERCISE 09 23/09/2018 11:03:09.

Experiment, sweep Transmission line length between both stubs

In the last part of the script, not reproduced here because there's still
an error pending correction, with a basic for loop that sweeps D3
between 1.1*/8 and 0.75*/8.

Resulting OC stub lengths stored in D_11 D_12 D_21 and D_22

_________________________________________________________________________________________________________________________
John Bofarull Guix jgb2012@sky.com 11 / 11

You might also like