Radiation Patterns
Radiation Patterns
OF
ANTENNA AND WAVE
PROPAGATION
Using MATLAB
DEPARTMENT OF EC
GOVERNMENT ENGINEERING COLLEGE
DAHOD -389151
Prepared By :
Prof. Alpesh H. Dafda
Asst. Prof. (E.C.)
CERTIFICATE
This
is
to
certify
that
__________________________________ Enrollement
number
____________________
has
successfully
term
ending
in
__________________
at
for partial
Date:
Place:
Subject Teacher
Head of Department
INDEX
NO
SUBJECT
DATE PAGE
To
perform
the
numerical
evaluation of directivity for a half
wave dipole.
10
11
To write a program
Microstrip Antenna.
to
Design
SIGN
REMARKS
12
13
14
15
16
17
18
19
20
21
22
Practical -1
AIM : To write a program to plot the radiation pattern of Dipole Antenna.
THEORY :
MATLAB PROGRAM
%This program print pattern (AF) for Short and any Dipole
%Antenna by giving the length of your Dipole and the
%wavelength you work with
clc;
lamda=input('enter the value of wave length= ');
l=input('enter your dipole length l in terms of lamda(for ex:
0.5 for 0.5lamda)= ');
ratio=l/lamda;
B=(2*pi/lamda);
theta= pi/100:pi/100:2*pi;
if ratio<= 0.1
%check if Short Dipole
E=sin(theta);
En=abs(E);
polar(theta,En)
%This plot polar pattern in plane
which dipole appear as line
else
%check if not short dipole
f1=cos(B*l/2.*cos(theta));
f2=cos(B*l/2);
f3=sin(theta);
E=(f1-f2)./f3;
En=abs(E);
polar(theta,En)
%This plot polar pattern in plane
which dipole appear as line
end
OUTPUT
90
120
60
0.8
0.6
150
30
0.4
0.2
180
210
330
240
300
270
CONCLUSIONS :
Practical - 2
AIM : To write a program to plot radiation pattern of Monopole antenna.
THEORY :
MATLAB PROGRAM
90
120
60
0.8
0.6
150
30
0.4
0.2
180
210
330
240
300
270
CONCLUSIONS :
10
Practical -3
AIM : To write a program to plot radiation pattern of Loop antenna.
THEORY :
11
MATLAB PROGRAM :
%This program print pattern for Loop Antenna by giving the
%radius of your Loop and the wavelength you work with
clc;
lamda=input('enter the value of wave length= ');
a=input('enter your loop radius a= ');
B=(2*pi/lamda);
theta= pi/100:pi/100:2*pi;
E=besselj(1,B*a.*sin(theta));
polar(theta,E)
OUTPUT :
enter the value of wave length= 1
enter your loop radius a= 0.5
90
0.6
120
60
0.4
150
30
0.2
180
210
330
240
300
270
CONCLUSIONS :
12
Practical - 4
AIM
THEORY :
13
MATLAB PROGRAM :
%This program print pattern for linear Array (uniform) Antenna
%by giving N,alfa,d and the wavelength you work with
%if you want full pattern multiply this pattern by any Antenna
%pattern
clc;
lamda=input('enter the value of wave length= ');
N=input('enter the no. of elements(3,4,5...)= ');
alfa=input('enter your progressive phase(alpha=0,45...)= ');
d=input('enter the seperation distance between elements(in
terms of lamda for ex: 0.3 for 0.3lamda)= ');
B=(2*pi/lamda);
theta= pi/100:pi/100:2*pi;
w=alfa+B*d.*cos(theta);
AF=sinc(N*(w./2))./sinc(w./2);
polar(theta,AF)
OUTPUT
enter
enter
enter
enter
lamda
14
90
120
60
0.8
0.6
150
30
0.4
0.2
180
210
330
240
300
270
CONCLUSIONS :
15
Practical - 5
AIM
THEORY :
16
MATLAB PROGRAM :
% This program print pattern for circular Array (uniform)
%Antenna by giving N,a and the wavelength you work with
%if you want full pattern multiply this pattern by any Antenna
%pattern
clc;
lamda=input('enter the value of wave length= ');
N=input('enter the no. of elements(3,4,5...)= ');
a=input('enter your circular radius( in terms of lamda for ex
0.2 for 0.2lamda)= ');
theta0=input('enter angle theta at which main lobe occurs(ex:
45)= ');
phi0=input('enter angle phi at which main lobe occurs(ex: 90)=
');
B=(2*pi/lamda);
theta= pi/100:pi/100:2*pi;
phi=pi/100:pi/100:2*pi;
f1=sin(theta0)*cos(phi0);
f2=sin(theta0)*sin(phi0);
f3=sin(theta).*cos(phi);
f4=sin(theta).*sin(phi);
x=f3-f1;
y=f4-f2;
ro=a.*sqrt(x.^2+y.^2);
AFn=besselj(0,B.*ro);
polar(theta,AFn)
OUTPUT
17
90
120
60
0.8
0.6
150
30
0.4
0.2
180
210
330
240
300
270
CONCLUSIONS :
18
Practical - 6
AIM : To write program to plot radiation pattern of rectangular aperture
antenna.
THEORY :
19
MATLAB PROGRAM :
% This program prints electric field pattern for rectangular
%Aperture Antenna by giving the a,b
%and the wavelength you work with
kind=input('Enter your antenna type Rectangular (1) or
circular (2)= ');
lamda=input('enter the value of wave length= ');
theta= pi/100:pi/100:2*pi;
B=(2*pi/lamda);
u0=0;
%@phi=90
u=B.*(sin(theta));
v0=0;
%@phi=0
v=B.*(sin(theta));
if kind==1
feeding=input('enter your feeding type "uniform(1),blocked
in one dim. Aperture(2),TE10(3)": ');
if feeding==1
%uniform
a=input('enter ur larg rectanglar length a= ');
b=input('enter ur small rectanglar length b= ');
E1=sinc((b.*v)./2);
%E-plane phi=90
E2=sinc((a.*u)./2);
%H-plane phi=0
subplot(3,3,1)
polar(theta,E1),title('E-plane')
subplot(3,3,2)
polar(theta,E1),title('H-plane')
elseif feeding==2
%blocked
delta=input('enter value of blocking= ');
E1=(b.*sinc((b.*v)./2)) (delta.*sinc((delta.*v)./2));
%E-plane
E2=sinc((a.*u)./2);
%H-plane phi=0
subplot(3,3,3)
polar(theta,E1),title('E-plane')
subplot(3,3,4)
polar(theta,E1),title('H-plane')
elseif feeding==3
%TE10
E1=sinc((b.*v)./2);
%E-plane phi=90
f1=(a/2).*(u-(pi/a));
f2=(a/2).*(u+(pi/a));
E2=sinc(f1)+sinc(f2); %H-plan phi=0
subplot(3,3,5)
polar(theta,E1),title('E-plane')
subplot(3,3,6)
polar(theta,E1),title('H-plane')
end
elseif kind==2
a=input('Enter radius of Circular Aperture= ');
20
f1=B*a;
f=f1.*(sin(theta));
E=(besselj(1,f))./f;
subplot(3,3,7)
polar(theta,E)
%E-plane or H-plane
end
OUTPUT
210
330
240 270 300
H-plane
1
120 90 60
0.5
150
30
180
210
330
240 270300
CONCLUSIONS :
21
Practical - 7
AIM
THEORY :
22
MATLAB PROGRAM :
%This program print pattern for TWA(Travelling Wave Antenna)
%by giving the length of your Line
%and the wavelength you work with
clc;
lamda=input('enter the value of wave length= ');
l=input('enter your Line length l= ');
B=(2*pi/lamda);
theta= pi/100:pi/100:2*pi;
f1=sin(theta);
f2=1-cos(theta);
f3=sin(B*l/2.*(f2));
E=(f1./f2).*f3;
En=abs(E);
polar(theta,En);
OUTPUT:
enter the value of wave length= 1
enter your Line length l= 1
90
120
60
1.5
1
150
30
0.5
180
210
330
240
300
270
CONCLUSIONS :
23
Practical - 8
AIM
THEORY :
24
MATLAB PROGRAM :
% clc;
N=4
90
120
60
60
0.8
0.6
0.6
150
30
150
30
0.4
0.4
0.2
0.2
180
210
180
330
240
120
0.8
210
300
330
240
270
300
270
25
N=8
N=16
90
90
120
60
120
60
0.8
0.8
0.6
0.6
150
30
150
30
0.4
0.4
0.2
0.2
180
180
210
330
240
210
330
300
240
300
270
270
Observation:
As the number of isotropic antennas increase, the
directivity increases.
d=/2
90
120
60
60
0.8
0.8
0.6
0.6
150
30
150
30
0.4
0.4
0.2
0.2
180
180
210
330
240
120
210
300
330
240
270
300
270
26
d=
d=3/4
90
90
120
60
120
60
0.8
0.8
0.6
0.6
150
30
150
30
0.4
0.4
0.2
0.2
180
180
210
330
240
210
330
300
240
300
270
270
d=5/2
d=3/2
90
90
120
60
0.8
0.8
0.6
0.6
150
150
30
30
0.4
0.4
0.2
0.2
180
180
210
210
330
240
120
60
330
240
300
300
270
270
27
=45
90
90
120
60
60
0.8
0.6
0.6
150
30
150
0.4
30
0.4
0.2
0.2
180
210
180
330
240
210
300
330
240
270
300
270
=90
90
=135
90
120
60
120
60
0.8
0.8
0.6
0.6
150
30
150
30
0.4
0.4
0.2
0.2
180
180
210
330
240
120
0.8
210
300
330
240
270
300
270
28
Practical - 9
AIM :
THEORY :
29
MATLAB PROGRAM :
% sum=0.0;
N=input(Enter the number of segments in the theta
direction\n);
for i=1:N
thetai=(pi/N)*(i-0.5);
sum=sum+(cos((pi/2)*cos(thetai)))^2/sin(thetai);
end
D=(2*N)/(pi*sum)
OUTPUT
30
Practical - 10
AIM
THEORY :
31
32
MATLAB PROGRAM :
% for i=1:100
theta(i)=pi*(i-1)/99;
d(i)=7.5*((cos(theta(i)))^2)*((sin(theta(i)))^2);
end
polar(theta,d)
OUTPUT
90
120
60
1.5
1
150
30
0.5
180
210
330
240
300
270
CONCLUSIONS :
33
Practical - 11
AIM :
THEORY :
34
MATLAB PROGRAM :
% clc
clear all
format long
% er=2.2;
% f=10e9;
% h=0.1588*10;
er=input('Enter the di-electric constant:');
h=input('Enter the substrate thickness (in mil)');
f=input('Enter the frequency (GHz):');
% er=3.5;
f=f*1e9;
h=h*0.0254; % in mm
wid=(3e8/(sqrt((er+1)/2)*2*f))*1000; %in mm
e_eff=((er+1)/2)+ (((er-1)/2)* (1+((12*h)/wid))^-0.5);
l_eff=(3e8/(2*f*sqrt(e_eff)))*1000;
del_l=(((e_eff+0.3)*((wid/h)+0.264))/((e_eff0.258)*((wid/h)+0.8)))*(0.412*h); %in mm
L=l_eff-(2*del_l);
la=(3e8/f)*1000;
k=(2*pi)/la;
x=k*(wid);
i1=-2+cos(x)+(x*sinint(x))+(sin(x)/x);
g1=i1/(120*pi*pi);
%Conductance % jb=besselj(0,(k.*L.*sin(th)));
a=@(th)(((sin((x./2).*cos(th))./cos(th)).^2).*(besselj(0,(k.*L
.*sin(th)))).*(sin(th)).^3); a1=quad(a,0,pi);
g12=a1/(120*pi*pi); %in siemens
r_in=1/(2*(g1+g12)); %in ohms
inset=(L/pi)*(acos(sqrt(50/r_in))); %in mm
disp(['The width is:',num2str(wid),' mm'])
disp(['The length is:',num2str(L),' mm'])
disp(['The inset feed point is:',num2str(inset),' mm'])
OUTPUT :
Enter the di-electric constant:12
Enter the substrate thickness (in mil)15
Enter the frequency (GHz):7
The width is:8.405 mm
The length is:6.1601 mm
The inset feed point is:2.5294 mm
CONCLUSIONS :
35
Practical - 12
36
MATLAB PROGRAM :
% a = 8; b = 4;
[theta,phi] = meshgrid(0:1:90, 0:9:360);
theta = theta*pi/180; phi = phi*pi/180;
vx = a*sin(theta).*cos(phi);
vy = b*sin(theta).*sin(phi);
E = abs((1 + cos(theta))/2 .* sinc(vx) .* sinc(vy));
surfl(vx,vy,E);
shading interp; colormap(gray(16));
OUTPUT
1
0.8
0.6
0.4
0.2
0
4
2
10
5
-2
-5
-4
-10
CONCLUSIONS :
37
Practical - 13
38
MATLAB PROGRAM :
% a = 3;
[theta,phi] = meshgrid(0:1:90, 0:9:360);
theta = theta*pi/180; phi = phi*pi/180;
vx = a*sin(theta).*cos(phi);
vy = a*sin(theta).*sin(phi);
u = a*sin(theta);
E = ones(size(u));
i = find(u);
E(i) = abs(2*besselj(1,2*pi*u(i))./(2*pi*u(i)));
surfl(vx,vy,E);
shading interp; colormap(gray(16));
OUTPUT
1
0.8
0.6
0.4
0.2
0
4
2
4
2
-2
-2
-4
-4
CONCLUSIONS :
39
Practical - 14
AIM
THEORY :
40
MATLAB PROGRAM :
% function []=horn;
disp('E-Plane and H-Plane Horn Specifications');
%R1=[]; R2=[];
%R1 = input('rho1(in wavelengths) = ');
%R2 = input('rho2(in wavelengths) = ');
R1=6; R2=6;a=0.5; b=0.25; a1=5.5; b1=2.75;
%a=[]; b=[];
%a = input('a(in wavelengths) = ');
%b = input('b(in wavelengths) = ');
%a1=[]; b1=[];
%a1 = input('a1(in wavelengths) = ');
%b1 = input('b1(in wavelengths) = ');
u = (1/sqrt(2))*((sqrt(R2)/a1)+(a1/sqrt(R2)));
v = (1/sqrt(2))*((sqrt(R2)/a1)-(a1/sqrt(R2)));
u = Fresnel(u);
v = Fresnel(v);
w = Fresnel(b1/sqrt(2*R1));
DH = 4*pi*b*R2/a1*((real(u)-real(v))^2 + (imag(u)-imag(v))^2);
DE = 64*a*R1/(pi*b1)*((real(w))^2 + (imag(w))^2);
DP = pi/(32*a*b)*DE*DH;
k = 2*pi;
Emax = 0;
Hmax = 0;
% E and H plane Outputs
% E-Plane Amplitude
for(theta = 0:0.5:360);
I = theta*2 + 1;
theta = theta*pi/180;
phi = pi/2;
ky = k*sin(theta);
kxp = pi/a1;
kxdp = -pi/a1;
t1 = sqrt(1/(pi*k*R1))*(-k*b1/2-ky*R1);
t2 = sqrt(1/(pi*k*R1))*(k*b1/2-ky*R1);
t1p = sqrt(1/(pi*k*R2))*(-k*a1/2-pi/a1*R2);
t2p = sqrt(1/(pi*k*R2))*(k*a1/2-pi/a1*R2);
t1dp = -t2p;
t2dp = -t1p;
I1 =.5*sqrt(pi*R2/k)*(exp(j*R2/(2*k)*kxp^2)*(Fresnel(t2p)Fresnel(t1p)) + exp(j*R2/(2*k)*kxdp^2)*(Fresnel(t2dp) Fresnel(t1dp)));
I2 = sqrt(pi*R1/k) * exp(j*R1/(2*k)*ky^2) * (Fresnel(t2) Fresnel(t1));
y(I) = (1 + cos(theta))*I1*I2;
y(I) = abs(y(I));
end
for(I = 1:721)
if(y(I) > Emax)
Emax = y(I);
41
end
end
for(I = 1:721)
if(y(I) <= 0)
Edb = -100;
else
Edb = 20*log10(abs(y(I))/Emax);
end
theta = (I-1)/2;
x(I)=theta;
q1(I)=Edb;
end
% H-Plane Amplitude
for(theta = 0:0.5:360);
I = theta*2 + 1;
theta = theta*pi/180;
phi = 0;
kxp = k*sin(theta) + pi/a1;
kxdp = k*sin(theta) - pi/a1;
t1 = sqrt(1/(pi*k*R1))*(-k*b1/2);
t2 = sqrt(1/(pi*k*R1))*(k*b1/2);
t1p = sqrt(1/(pi*k*R2))*(-k*a1/2-kxp*R2);
t2p = sqrt(1/(pi*k*R2))*(k*a1/2-kxp*R2);
t1dp = sqrt(1/(pi*k*R2))*(-k*a1/2-kxdp*R2);
t2dp = sqrt(1/(pi*k*R2))*(k*a1/2-kxdp*R2);
I1 = .5*sqrt(pi*R2/k)*(exp(j*R2/(2*k)*kxp^2)*(Fresnel(t2p)Fresnel(t1p)) + exp(j*R2/(2*k)*kxdp^2)*(Fresnel(t2dp) Fresnel(t1dp)));
I2 = sqrt(pi*R1/k) * exp(j*R1/(2*k)*ky^2) * (Fresnel(t2) Fresnel(t1));
y(I) = (1 + cos(theta))*I1*I2;
y(I) = abs(y(I));
end
for(I = 1:721)
if(y(I) > Hmax)
Hmax = y(I);
end
end
for(I = 1:721)
if(y(I) <= 0)
Hdb = -100;
else
Hdb = 20*log10(abs(y(I))/Hmax);
end
theta = (I-1)/2;
x(I)=theta;
q2(I)=Hdb;
end
% Figure 1
ha=plot(x,q1); set(ha,'linestyle','-','linewidth',2);
hold on; hb=plot(x,q2,'r--'); set(hb,'linewidth',2);
42
xlabel('Theta (degrees)');
ylabel('Field Pattern (dB)');
title('Horn Analysis');
legend('E-Plane','H-Plane');
grid on;
axis([0 360 -60 0]);
% Figure 2
figure(2)
ht1=polar(x*pi/180,q1,'b-');
hold on;
ht2=polar(x*pi/180,q2,'r--');
set([ht1 ht2],'linewidth',2);
legend([ht1 ht2],{'E-plane','H-plane'});
title('Field patterns');
% Directivity Output
directivity = 10*log10(DP)
% Fresnel Subfunction
function[y] = Fresnel(x);
A(1) = 1.595769140;
A(2) = -0.000001702;
A(3) = -6.808508854;
A(4) = -0.000576361;
A(5) = 6.920691902;
A(6) = -0.016898657;
A(7) = -3.050485660;
A(8) = -0.075752419;
A(9) = 0.850663781;
A(10) = -0.025639041;
A(11) = -0.150230960;
A(12) = 0.034404779;
B(1) = -0.000000033;
B(2) = 4.255387524;
B(3) = -0.000092810;
B(4) = -7.780020400;
B(5) = -0.009520895;
B(6) = 5.075161298;
B(7) = -0.138341947;
B(8) = -1.363729124;
B(9) = -0.403349276;
B(10) = 0.702222016;
B(11) = -0.216195929;
B(12) = 0.019547031;
CC(1) = 0;
CC(2) = -0.024933975;
CC(3) = 0.000003936;
CC(4) = 0.005770956;
CC(5) = 0.000689892;
CC(6) = -0.009497136;
CC(7) = 0.011948809;
CC(8) = -0.006748873;
CC(9) = 0.000246420;
43
CC(10) = 0.002102967;
CC(11) = -0.001217930;
CC(12) = 0.000233939;
D(1) = 0.199471140;
D(2) = 0.000000023;
D(3) = -0.009351341;
D(4) = 0.000023006;
D(5) = 0.004851466;
D(6) = 0.001903218;
D(7) = -0.017122914;
D(8) = 0.029064067;
D(9) = -0.027928955;
D(10) = 0.016497308;
D(11) = -0.005598515;
D(12) = 0.000838386;
if(x==0)
y=0;
return
elseif(x<0)
x=abs(x);
x=(pi/2)*x^2;
F=0;
if(x<4)
for(k=1:12)
F=F+(A(k)+j*B(k))*(x/4)^(k-1);
end
y = F*sqrt(x/4)*exp(-j*x);
y = -y;
return
else
for(k=1:12)
F=F+(CC(k)+j*D(k))*(4/x)^(k-1);
end
y = F*sqrt(4/x)*exp(-j*x)+(1-j)/2;
y =-y;
return
end
else
x=(pi/2)*x^2;
F=0;
if(x<4)
for(k=1:12)
F=F+(A(k)+j*B(k))*(x/4)^(k-1);
end
y = F*sqrt(x/4)*exp(-j*x);
return
else
for(k=1:12)
F=F+(CC(k)+j*D(k))*(4/x)^(k-1);
end
y = F*sqrt(4/x)*exp(-j*x)+(1-j)/2;
44
return
end
end
OUTPUT
-10
-20
-30
-40
-50
-60
50
100
150
200
Theta (degrees)
45
250
300
350
Field patterns
90
100
120
60
80
E-plane
H-plane
60
150
30
40
20
180
210
330
240
300
270
CONCLUSIONS :
46
Practical - 15
AIM : To write a program to plot the radiation pattern of a Optimized
six-element Yagi-Uda antenna.
THEORY :
47
%
imput impedance of driven element is 1/I(2)
%
%
the currents I can be passed to ARRAY2D to compute the
array gain
function [I,D,Rfb] = yagi(L,a,d)
if nargin==0, help yagi; return; end
K = length(L);
more antennas, K>=3
Z = impedmat(L,a,d);
matrix for the yagi array
% mutual impedance
V = [0; 1; zeros(K-2,1)];
V(2) = 1
% driving voltage
I = Z \ V;
% solve Z*I = V
Nint = 16;
Legendre quadrature points
% number of Gauss-
[wth,th] = quadr(0,pi,Nint);
and angle points
[wph,ph] = quadr(0,2*pi,Nint);
% quadrature weights
A = zeros(Nint,Nint);
of array factor
Af = 0;
Ab = 0;
% matrix of values
h = L/2;
for p=1:K,
A = A + I(p) * F(h(p),d(p),th,ph);
Af = Af + I(p) * F(h(p),d(p),pi/2,0);
endfire
Ab = Ab + I(p) * F(h(p),d(p),pi/2,pi);
endfire
end
Rfb = abs(Af/Ab)^2;
ratio
% forward
% backward
% forward-backward
A = A / Af;
g = abs(A.*A);
% normalized gain
for m=1:Nint,
49
g(:,m) = g(:,m).*sin(th);
dOmega = sin(th)*dth*dph
end
% integrate over
D = 4*pi / DOm;
% directivity
% -------------------------------------------------------------------------------function A = F(h,d,th,ph)
dipole at distance x=d
% array factor of
k = 2*pi;
th = th(:);
ph = ph(:)';
% theta is a column
% phi is a row
G = zeros(length(th),1);
dipole pattern values
% G(th) is column of
cos(k*h))
./
(sin(k*h)
% displacement phase
for m=1:length(ph),
A(:,m) = A(:,m) .* G;
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% gain2.m - normalized gain of arbitrary 2D array of linear
sinusoidal antennas
%
% Usage: [ge,gh,th] = gain2(L,d,I,N,ph0)
%
[ge,gh,th] = gain2(L,d,I,N)
(equivalent to ph0=0)
%
% L
= antenna lengths in wavelengths, L = [L1,L2,...,LK]
% d
= [x,y] or [x] locations of the K antennas, d must be Kx2
or Kx1 or 1xK
% I
= input currents at antenna terminals, I = [I1,I2,...,IK]
= Kx1 or 1xK
% N
= number of azimuthal and polar angles over [0,2*pi]
% ph0 = azimuthal direction for E-plane pattern (in degrees)
%
50
% U(th,phi)
K = length(L);
51
if max(size(d))~=K,
error('d must have size Kx2 or Kx1 or 1xK');
end
if min(size(d))==1,
d = [d(:),zeros(K,1)];
into [x,y] pairs
end
% make d
ph0 = ph0*pi/180;
th
= 0 : 2*pi/N : 2*pi;
for i=1:N+1,
ge(i) = U(L,d,I,th(i),ph0);
gh(i) = U(L,d,I,pi/2,th(i));
the azimuthal angle
end
% here th is
ge = ge/max(ge);
gh = gh/max(gh);
% --------------------------------------------------------------------------function G = U(L,d,I,th,phi)
intensity U(th,phi)
% radiation
k = 2*pi;
kx = k*sin(th)*cos(phi);
ky = k*sin(th)*sin(phi);
kz = k*cos(th);
x = d(:,1);
y = d(:,2);
A = (I./sin(pi*L)) .*
dimensional array factor
(exp(j*kx*x).*exp(j*ky*y));
if sin(th)==0,
antenna elements
F = zeros(length(L),1);
dimensional column
else
F = (cos(k*L*cos(th)/2) - cos(k*L/2)) / sin(th);
end
if max(L)==0,
array case
F = ones(K,1);
K-
% gains of
% F is K-
% isotropic
52
end
G = abs(F'*A)^2;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% dbz2.m - azimuthal gain plot in dB - 2pi angle range
%
% Usage: h = dbz2(phi, g, rays, Rm, width)
%
% Examples: dbz2(phi, g);
default (30-degree
lines and 40-dB scale)
%
dbz2(phi, g, 45);
use 45-degree grid
lines
%
dbz2(phi, g, 30, 60);
30-degree rays and
60-dB scale
%
dbz2(phi, g, 30, 60, 1.5);
use thicker line for
gain
%
h = dbz2(phi, g, 30, 60, 1.5); use h to add legends
(see dbadd)
%
% plots 10*log10(g(phi)), it assumes max-g is unity
% phi = azimuthal angles over [0,2pi]
%
% rays = 30 degrees by default, and can be omitted
% rays = 45 draws rays at 45-degree angles
%
% Rm = minimum dB level
% Rm = 40 by default
% Rm/4, 2Rm/4, 3Rm/4 grid circles displayed
%
% width = linewidth of gain curve
% width = 1.0 points by default
% width = 1.5 for thicker line
%
% useful when the gain is not an even function of phi,
% as for an array along the y-axis
%
% see also DBZ, ABZ, ABZ2, ABP, DBP, ARRAY
function h = dbz2(phi, g, rays, Rm, width)
if
if
if
if
sty = ':';
line style
% grid
53
% make g=0
% lowest
% scale to
x = gdb .* cos(phi);
y = gdb .* sin(phi);
N0 = 400;
phi0 = (0:N0) * 2*pi / N0;
x0 = sin(phi0);
circles
y0 = cos(phi0);
% gain
0.50*x0,
0.50*y0,
sty,
axis square;
R = 1.1;
axis([-R, R, -R, R]);
axis off;
Nf = 15;
% fontsize of labels
line([0,0],[-1,1]);
line([-1,1],[0,0]);
text(0, 1.02,
' 90^o',
'vert', 'bottom');
text(0, -0.99, '-90^o',
'vert', 'top');
Nf,
'horiz',
'center',
'\phi',
if rays == 45,
x1 = 1/sqrt(2); y1 = 1/sqrt(2);
line([-x1,x1], [-y1,y1], 'linestyle', sty);
line([-x1,x1], [y1,-y1], 'linestyle', sty);
54
'fontsize',
text(1.04*x1, y1,
'45^o',
'fontsize',
'left', 'vert', 'bottom');
text(0.97*x1, -0.97*y1,
'-45^o', 'fontsize',
'left', 'vert', 'top');
text(-0.97*x1, 1.02*y1,
'135^o',
'fontsize',
'right', 'vert', 'bottom');
text(-1.01*x1, -1.01*y1, '-135^o', 'fontsize',
'right', 'vert', 'top');
else
x1 = cos(pi/3); y1 = sin(pi/3);
x2 = cos(pi/6); y2 = sin(pi/6);
line([-x1,x1], [-y1,y1], 'linestyle', sty);
line([-x2,x2], [-y2,y2], 'linestyle', sty);
line([-x2,x2], [y2,-y2], 'linestyle', sty);
line([-x1,x1], [y1,-y1], 'linestyle', sty);
text(1.02*x1,1.02*y1,
'60^o',
'horiz', 'left', 'vert', 'bottom');
text(0.95*x1,-0.97*y1,
'-60^o',
'horiz', 'left', 'vert', 'top');
text(1.04*x2,0.97*y2, '30^o', 'fontsize', Nf,
'vert', 'bottom');
text(0.98*x2,-0.93*y2,
'-30^o',
'horiz', 'left', 'vert', 'top');
text(-0.91*x1,1.02*y1,
'120^o',
'right', 'vert', 'bottom');
text(-0.97*x1,-1.01*y1, '-120^o',
'right', 'vert', 'top');
text(-1.02*x2,0.97*y2,
'150^o',
'right', 'vert', 'bottom');
text(-1.01*x2,-1.01*y2, '-150^o',
'right', 'vert', 'top');
end
Nf, 'horiz',
Nf,
'horiz',
Nf, 'horiz',
Nf,
'horiz',
'fontsize',
Nf,
'fontsize',
Nf,
'horiz', 'left',
'fontsize',
'fontsize',
'fontsize',
'fontsize',
'fontsize',
Nf,
Nf,
'horiz',
Nf,
'horiz',
Nf,
'horiz',
Nf,
'horiz',
s1 = sprintf('-%d', 0.25*Rm);
s2 = sprintf('-%d', 0.50*Rm);
s3 = sprintf('-%d', 0.75*Rm);
text(0.765, 0.125, s1, 'fontsize', Nf, 'horiz', 'left', 'vert',
'top');
text(0.515, 0.125, s2, 'fontsize', Nf, 'horiz', 'left', 'vert',
'top');
text(0.265, 0.125, s3, 'fontsize', Nf, 'horiz', 'left', 'vert',
'top');
text(0.55, -0.005,
'vert', 'top');
'dB',
'fontsize',
Nf,
'horiz',
'left',
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
55
sty = ':';
style
% grid line
56
% make g=0
% lowest is
% scale to
x = gdb .* sin(th);
plotted vertically
y = gdb .* cos(th);
% x-axis
N0 = 400;
phi0 = (0:N0) * 2*pi / N0;
x0 = sin(phi0);
circles
y0 = cos(phi0);
% gain
0.50*x0,
0.50*y0,
sty,
axis square;
R = 1.1;
axis([-R, R, -R, R]);
axis off;
Nf = 15;
% fontsize of labels
line([0,0],[-1,1]);
line([-1,1],[0,0]);
text(0, 1.02,
' 0^o',
'vert', 'bottom');
text(0, -0.99, ' 180^o',
'vert', 'top');
Nf,
'horiz',
'center',
57
'\theta',
'\theta',
text(1.04*x1, y1,
'45^o',
'fontsize',
'left', 'vert', 'bottom');
text(0.98*x1, -0.98*y1,
'135^o', 'fontsize',
'left', 'vert', 'top');
text(-0.97*x1, 1.02*y1,
'45^o',
'fontsize',
'right', 'vert', 'bottom');
text(-1.01*x1, -1.01*y1, '135^o', 'fontsize',
'right', 'vert', 'top');
else
x1 = cos(pi/3); y1 = sin(pi/3);
x2 = cos(pi/6); y2 = sin(pi/6);
line([-x1,x1], [-y1,y1], 'linestyle', sty);
line([-x2,x2], [-y2,y2], 'linestyle', sty);
line([-x2,x2], [y2,-y2], 'linestyle', sty);
line([-x1,x1], [y1,-y1], 'linestyle', sty);
Nf, 'horiz',
Nf,
'horiz',
Nf,
'horiz',
Nf,
'horiz',
text(1.02*x1,1.02*y1,
'30^o',
'fontsize', Nf,
'left', 'vert', 'bottom');
text(0.96*x1,-0.98*y1,
'150^o',
'fontsize',
Nf,
'left', 'vert', 'top');
text(1.04*x2,0.97*y2,
'60^o',
'fontsize', Nf,
'left', 'vert', 'bottom');
text(x2,-0.95*y2,
'120^o', 'fontsize', Nf,
'left', 'vert', 'top');
'horiz',
text(-0.91*x1,1.02*y1,
'right', 'vert', 'bottom');
text(-0.97*x1,-1.01*y1,
'right', 'vert', 'top');
text(-1.02*x2,0.97*y2,
'right', 'vert', 'bottom');
text(-1.01*x2,-1.01*y2,
'right', 'vert', 'top');
end
'horiz',
'30^o',
'150^o',
'60^o',
'120^o',
'fontsize',
'fontsize',
'fontsize',
'fontsize',
Nf,
'horiz',
'horiz',
'horiz',
Nf,
'horiz',
Nf,
'horiz',
Nf,
'horiz',
s1 = sprintf('-%d', 0.25*Rm);
s2 = sprintf('-%d', 0.50*Rm);
s3 = sprintf('-%d', 0.75*Rm);
text(0.765, 0.125, s1, 'fontsize', Nf, 'horiz', 'left', 'vert',
'top');
text(0.515, 0.125, s2, 'fontsize', Nf, 'horiz', 'left', 'vert',
'top');
text(0.265, 0.125, s3, 'fontsize', Nf, 'horiz', 'left', 'vert',
'top');
text(0.55, -0.005,
'vert', 'top');
'dB',
'fontsize',
Nf,
'horiz',
'left',
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
58
OUTPUT
:
120o
90o
30o
60o
150o
0o
30o
60o
30o
60o
180
-30o
-150o
-120o
-90o
90o
120o
120o
-60o
150o
CONCLUSIONS :
59
180o
150o
Practical - 16
AIM
60
MATLAB PROGRAM :
% tic;
clear;
clc;
%%Intialisation
% AF
=
zeros(1,360);
% AE
=
zeros(1,360);
%%ACCEPTING INPUTS..
N= 7;%input('\nEnter the number of Elements::->');
d= 0.5;%input('\nEnter the distance between the elements::>');
k= 360;
beta=
0;
theta=1:360;
%%CALCULATING ARRAY FACTOR AND ARRAY ELEMENT...
psi=
AF=
AE=
(k.*d.*cosd(theta)) + beta;
(1+exp(1j.*(deg2rad(psi)))).^(N-1);
(cosd(90.*cosd(theta)))./sind(theta);
AF=abs(AF);
%%PLOTTING...
theta= linspace(0,2*pi,360);
subplot(221);
polar(theta,AE)
subplot(222);
polar(theta,AF)
subplot(2,2,[3,4]);
polar(theta,AE.*AF)
legend('Binomial array','Location','SouthEastOutside')
toc;
61
OUTPUT
120
90 1
60
0.5
30
150
180
120
150
210
180
330
240
270
120
150
90 100
60
50
30
0
210
300
330
240
270
90 100
60
50
30
180
210
330
240
270
300
Binomial array
CONCLUSIONS :
62
300
Practical - 17
63
MATLAB PROGRAM :
%%MATLAB PROGRAM FOR BROADSIDE ARRAY....
clear;
clc;
tic;
%%Initialising
AF
=
zeros(1,360);
AE
=
zeros(1,360);
theta=1:360;
%%ACCEPTING INPUTS..
N=
d=
k=
c=
((1./N).*sind(N.*c.*cosd(theta)));
sind(c.*cosd(theta));
num./den;
(cosd(90.*cosd(theta)))./sind(theta);
AF=abs(AF);
%%PLOTTING...
theta= linspace(0,2*pi,360);
subplot(221);
polar(theta,AE)
subplot(222);
polar(theta,AF)
subplot(2,2,[3,4]);
polar(theta,AE.*AF)
legend('Broadside array','Location','SouthEastOutside')
toc;
64
OUTPUT
90 1
120
60
0.5
30
150
180
120
180
330
240
270
120
60
0.5
30
150
210
90 1
210
300
330
240
270
90 1
60
0.5
30
150
180
210
330
240
270
300
Broadside array
CONCLUSIONS :
65
300
Practical - 18
AIM : To write a program to plot radiation pattern for Endfire antenna
array.
THEORY :
66
MATLAB PROGRAM :
% clear;
clc;
tic;
%%Initialisation
%AF
=
zeros(1,360);
%AE
=
zeros(1,360);
theta=1:360;
%%ACCEPTING INPUTS..
N=
d=
k=
c=
((1./N).*sind(N.*c.*(cosd(theta)+1)));
sind(c.*(cosd(theta)+1));
num./den;
(cosd(90.*cosd(theta-90)))./sind(theta-90);
AF=abs(AF);
%%PLOTTING...
theta= linspace(0,2*pi,360);
subplot(221);
polar(theta,AE)
subplot(222);
polar(theta,AF)
subplot(2,2,[3,4]);
polar(theta,AE.*AF)
legend('Endfire array','Location','SouthEastOutside')
toc;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
67
OUTPUT
90 1
120
60
0.5
30
150
180
120
180
330
240
270
210
300
120
60
0.5
30
150
210
90 1
330
240
270
90 1
60
0.5
30
150
180
210
330
240
270
300
Endfire array
CONCLUSIONS :
68
300
Practical - 19
AIM
THEORY :
69
MATLAB PROGRAM :
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% MATLAB code for Binomial Array in 3D
%% Pre-initialisation
clear;
clc;
close all;
%% Accepting inputs
N = input('\nEnter the number of Elements::(eg., 5,6,7,etc)>');
d = input('\nEnter the distance between the
elements::(eg.,0.4,0.5,etc)->');
tic;
k = 2*pi;
beta =
0;
[theta phi]=meshgrid(linspace(0,2*pi,180));
%% Calculating Array element(AE) and Array Factor(AF)
psi =
(k.*d.*cos(theta))
AF
AF
(1+exp(1j.*(psi))).^(N-1);
AF - min(min(AF));
=
=
+ beta;
AE = sqrt(1- ((sin(theta).^2).*(cos(phi).^2)));
%% Calculating Array Pattern(AP)
% Array Pattern is calculated as follows,
%
% Array Pattern = ArrayFactor * ArrayElement
AP = AF .* AE;
toc;
%% Plotting results
[x1,y1,z1] = sph2cart(phi,theta,abs(AE));
surf(x1,y1,z1,'FaceLighting','phong',...
'LineStyle','none',...
'FaceColor',[1 0 0]);
70
legend('Array Element','Location','SouthEastOutside')
light('Style','local',...
'Position',[-10.162701816704 -0.924193626363743
14.9951905283833]);
axis image
figure
[x2,y2,z2] = sph2cart(phi,theta,abs(AF));
surf(x2,y2,z2,'FaceLighting','phong',...
'LineStyle','none',...
'FaceColor',[1 0 0]);
light('Style','local',...
'Position',[-10.162701816704 -0.924193626363743
14.9951905283833]);
legend('Array Factor','Location','SouthEastOutside')
axis image
figure
[x3,y3,z3] = sph2cart(phi,theta,abs(AP));
surf(x3,y3,z3,'FaceLighting','phong',...
'LineStyle','none',...
'FaceColor',[1 0 0]);
light('Style','local',...
'Position',[-10.162701816704 -0.924193626363743
14.9951905283833]);
legend('Array Pattern','Location','SouthEastOutside')
axis image
OUTPUT
71
CONCLUSIONS :
72
Practical - 20
AIM
THEORY :
73
MATLAB PROGRAM :
%%% MATLAB code for Broadside Array in 3D
%% Pre-initialisation
clear;
clc;
close all;
%% Accepting inputs
N = input('\nEnter the number of Elements::(eg., 5,6,7,etc)>');
d = input('\nEnter the distance between the
elements::(eg.,0.4,0.5,etc)->');
tic;
[theta phi] = meshgrid(linspace(0,2*pi,180));
k = 2*pi;
c = (k.*d)./2;
%% Calculating Array element(AE) and Array Factor(AF)
num
den
AF
AF
=
=
=
=
((1./N).*sin(N.*c.*cos(theta)));
sin(c.*cos(theta));
num./den;
AF - min(min(AF));
AE = sqrt(1- ((sin(theta).^2).*(cos(phi).^2)));
%% Calculating Array Pattern(AP)
% Array Pattern is calculated as follows,
%
% Array Pattern = ArrayFactor * ArrayElement
AP = AF .* AE;
toc;
%% Plotting results
[x1,y1,z1] = sph2cart(phi,theta,AE);
surf(x1,y1,z1,'FaceLighting','phong',...
'LineStyle','none',...
'FaceColor',[1 0 0]);
legend('Array Element','Location','SouthEastOutside')
axis image
74
light('Style','local',...
'Position',[-10.162701816704 -0.924193626363743
14.9951905283833]);
figure
[x2,y2,z2] = sph2cart(phi,theta,AF);
surf(x2,y2,z2,'FaceLighting','phong',...
'LineStyle','none',...
'FaceColor',[1 0 0]);
legend('Array Factor','Location','SouthEastOutside')
axis image
light('Style','local',...
'Position',[-10.162701816704 -0.924193626363743
14.9951905283833]);
figure
[x3,y3,z3] = sph2cart(phi,theta,AP);
surf(x3,y3,z3,'FaceLighting','phong',...
'LineStyle','none',...
'FaceColor',[1 0 0]);
legend('Array Pattern of Broadside
array','Location','SouthEastOutside')
axis image
light('Style','local',...
'Position',[-10.162701816704 -0.924193626363743
14.9951905283833]);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%
75
OUTPUT
CONCLUSIONS :
76
Practical - 21
AIM
THEORY :
77
MATLAB PROGRAM :
%%% MATLAB code for Endfire Array in 3D
%% Pre-initialisation
clear;
clc;
close all;
%% Accepting inputs
N = input('\nEnter the number of Elements::(eg., 5,6,7,etc)>');
d = input('\nEnter the distance between the
elements::(eg.,0.4,0.5,etc)->');
tic;
[theta phi] = meshgrid(linspace(0,2*pi,360));
k = 2*pi;
c = (k.*d)./2;
%% Calculating Array element(AE) and Array Factor(AF)
num = ((1./N).*sin(N.*c.*(cos(theta)+1)));
den = sin(c.*(cos(theta)+1));
AF
AF
= num./den;
= AF - min(min(AF));
AE = sqrt(1- ((sin(theta).^2).*(cos(phi).^2)));
%% Calculating Array Pattern(AP)
% Array Pattern is calculated as follows,
%
% Array Pattern = ArrayFactor * ArrayElement
AP = AF .* AE;
toc;
%% Plotting results
[x1,y1,z1] = sph2cart(phi,theta,AE);
surf(x1,y1,z1,'FaceLighting','phong',...
'LineStyle','none',...
'FaceColor',[1 0 0]);
legend('Array Element','Location','SouthEastOutside')
78
axis image
light('Style','local',...
'Position',[-10.162701816704 -0.924193626363743
14.9951905283833]);
figure
[x2,y2,z2] = sph2cart(phi,theta,AF);
surf(x2,y2,z2,'FaceLighting','phong',...
'LineStyle','none',...
'FaceColor',[1 0 0]);
legend('Array Factor','Location','SouthEastOutside')
axis image
light('Style','local',...
'Position',[-10.162701816704 -0.924193626363743
14.9951905283833]);
figure
[x3,y3,z3] = sph2cart(phi,theta,AP);
surf(x3,y3,z3,'FaceLighting','phong',...
'LineStyle','none',...
'FaceColor',[1 0 0]);
legend('Array Pattern of Endfire
Array','Location','SouthEastOutside')
axis image
light('Style','local',...
'Position',[-10.162701816704 -0.924193626363743
14.9951905283833]);
OUTPUT
79
CONCLUSIONS :
80
Practical - 22
AIM
THEORY :
81
MATLAB PROGRAM :
%
%
%
%
Name:
RadPattern3D
Description:
3-D Radiation Pattern of Dipole Antenna
Reference
Constantine A.Balanis, Antenna Theory
Analysis And Design , 3rd Edition, page 173, eq. 4-64
%*************************************************************
*************
%Usage:
%This program plots 3-D radiation Pattern of a Dipole Antenna
%All the parameters are entered in the M-File
clear all
%Defining variables in spherical coordinates
theta=[0:0.12:2*pi];%theta vector
phi=[0:0.12:2*pi];%phi vector
l_lamda1=1/100;% length of antenna in terms of wavelengths
I0=1;% max current in antenna structure
n=120*pi;%eta
% evaluating radiation intensity(U)
U1=( n*( I0^2 )*( ( cos(l_lamda1*cos(theta-(pi/2))/2) cos(l_lamda1/2) )./ sin(theta-(pi/2)) ).^2 )/(8*(pi)^2);
%converting to dB scale
U1_1=10*log10(U1);
%normalizing in order to make U vector positive
min1=min(U1_1);
U=U1_1-min1;
% expanding theta to span entire space
U(1,1)=0;
for n=1:length(phi)
theta(n,:)=theta(1,:);
end
% expanding phi to span entire space
phi=phi';
for m=1:length(phi)
phi(:,m)=phi(:,1);
end
% expanding U to span entire space
for k=1:length(U)
U(k,:)=U(1,:);
end
82
30
20
10
0
-10
-20
-30
40
20
40
20
-20
-20
-40
-40
CONCLUSIONS :
83