SlideShare a Scribd company logo
1 of 83
Download to read offline
1
LAB MANUAL
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.)
2
CERTIFICATE
This is to certify that
__________________________________ Enrollement
number ____________________ has successfully
completed his/her term work and practical work in the
subject Antenna and Wave Propagation(161003) for
the term ending in __________________ at
Government Engineering College, Dahod, for partial
fulfillment of B.E. degree to be awarded by Gujarat
Technological University. This work has been carried
out under my supervision and is to my satisfaction.
Date:
Place:
Subject Teacher Head of Department
3
INDEX
NO SUBJECT DATE PAGE SIGN REMARKS
1 To write a program to plot the
radiation pattern of Dipole
Antenna.
2 To write a program to plot radiation
pattern of Monopole antenna.
3 To write a program to plot radiation
pattern of Loop antenna.
4 To write a Program to plot radiation
pattern of Linear array antenna.
5 To write a Program to plot radiation
pattern of Circular array antenna.
6 To write program to plot radiation
pattern of rectangular aperture
antenna.
7 To write a program to plot radiation
pattern of travelling wave antenna.
8 To write a program to plot radiation
pattern of linear array of isotropic
antennas.
9 To perform the numerical
evaluation of directivity for a half
wave dipole.
10 To write a program to determine
the directivity [D(θ,Φ)], the beam
solid angle ΩA and the maximum
directivity [Do] of an antenna
defined by F(θ,Φ) = sin2
θcos2
θ.
11 To write a program to Design
Microstrip Antenna.
4
12 To write a program to plot 3-D
pattern of Rectangular Apertures as
a function of the independent
variables vx, vy, for aperture
dimensions a = 8λ and b = 4λ.
13 To write a program to plot 3-D
pattern of Circular Aperture as a
function of the independent
variables vx = (a/λ)sinθcosφ and vy
= (a/λ)sinθsinφ, for an aperture
radius of a = 3λ.
14 To write a program to plot the
radiation pattern of a horn
antenna.
15 To write a program to plot the
radiation pattern of a Optimized
six-element Yagi-Uda antenna.
16 To write a program to plot the
radiation pattern for Binomial
antenna array.
17 To write a program to plot radiation
pattern for Broadside antenna
array.
18 To write a program to plot radiation
pattern for Endfire antenna array.
19 To write a program to plot 3D
radiation pattern for Binomial
antenna array.
20 To write a program to plot 3D
radiation pattern for Broadside
antenna array.
21 To write a program to plot 3D
radiation pattern for Endfire
antenna array.
22 To write a program to plot 3-D
Radiation Pattern of Dipole
Antenna.
5
Practical -1
AIM : To write a program to plot the radiation pattern of Dipole Antenna.
THEORY :
6
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 :
enter the value of wave length= 1
enter your dipole length l in terms of lamda(for ex: 0.5 for
0.5lamda)= 0.5
7
0.2
0.4
0.6
0.8
1
30
210
60
240
90
270
120
300
150
330
180 0
CONCLUSIONS :
8
Practical - 2
AIM : To write a program to plot radiation pattern of Monopole antenna.
THEORY :
9
MATLAB PROGRAM :
%%This program print pattern for Short and any monopole
%Antenna by giving the length of your Dipole
%and the wavelength you work with
lamda=input('enter the value of wave length= ');
l=input('enter your monopole length l= ');
ratio=l/lamda;
B=(2*pi/lamda);
theta= -pi/2:pi/100:pi/2;
if ratio<= 0.1 %check if Short monopole
E=sin(theta);
En=abs(E);
polar(theta,En) %This plot polar pattern in plane
which monopole appear as line
else %check if not short monopole
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 monopole appear as line
end
OUTPUT :
enter the value of wave length= 1
enter your monopole length l= 0.5
10
0.2
0.4
0.6
0.8
1
30
210
60
240
90
270
120
300
150
330
180 0
CONCLUSIONS :
11
Practical -3
AIM : To write a program to plot radiation pattern of Loop antenna.
THEORY :
12
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
0.2
0.4
0.6
30
210
60
240
90
270
120
300
150
330
180 0
CONCLUSIONS :
13
Practical - 4
AIM : To write a Program to plot radiation pattern of Linear array
antenna.
THEORY :
14
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 the value of wave length= 1
enter the no. of elements(3,4,5...)= 6
enter your progressive phase(alpha=0,45...)= 0
enter the seperation distance between elements(in terms of
lamda for ex: 0.3 for 0.3lamda)= 0.3
15
0.2
0.4
0.6
0.8
1
30
210
60
240
90
270
120
300
150
330
180 0
CONCLUSIONS :
16
Practical - 5
AIM : To write a Program to plot radiation pattern of Circular array
antenna.
THEORY :
17
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 :
enter the value of wave length= 1
enter the no. of elements(3,4,5...)= 2
enter your circular radius( in terms of lamda for ex 0.2 for
0.2lamda)= 0.2
enter angle theta at which main lobe occurs(ex: 45)= 45
enter angle phi at which main lobe occurs(ex: 90)= 90
18
0.2
0.4
0.6
0.8
1
30
210
60
240
90
270
120
300
150
330
180 0
CONCLUSIONS :
19
Practical - 6
AIM : To write program to plot radiation pattern of rectangular aperture
antenna.
THEORY :
20
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= ');
21
f1=B*a;
f=f1.*(sin(theta));
E=(besselj(1,f))./f; %E-plane or H-plane
subplot(3,3,7)
polar(theta,E)
end
OUTPUT :
Enter your antenna type Rectangular (1) or circular (2)= 1
enter the value of wave length= 1
enter your feeding type "uniform(1),blocked in one dim.
Aperture(2),TE10(3)": 1
enter ur larg rectanglar length a= 0.3
enter ur small rectanglar length b= 0.2
0.5
1
30
210
60
240
90
270
120
300
150
330
180 0
E-plane
0.5
1
30
210
60
240
90
270
120
300
150
330
180 0
H-plane
CONCLUSIONS :
22
Practical - 7
AIM : To write a program to plot radiation pattern of travelling wave
antenna.
THEORY :
23
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
0.5
1
1.5
2
30
210
60
240
90
270
120
300
150
330
180 0
CONCLUSIONS :
24
Practical - 8
AIM : To write a program to plot radiation pattern of linear array of
isotropic antennas.
THEORY :
25
MATLAB PROGRAM :
% clc;
lamda=input('enter the value of wave length(in
meter)= ');
N=input('enter the no. of elements= ');
alpha=input('enter your progressive phase= ');
d=input('enter the separation distance between
elements(in meter)= ');
beta=(2*pi/lamda);
theta= pi/100:pi/100:2*pi;
psi=alpha+beta*d.*cos(theta);
e=sin(N*(psi./2))./sin(psi./2);
polar(theta,e/N);
Case 1: When α=0, d=λ/4
N=2 N=4
0.2
0.4
0.6
0.8
1
30
210
60
240
90
270
120
300
150
330
180 0
0.2
0.4
0.6
0.8
1
30
210
60
240
90
270
120
300
150
330
180 0
26
N=8 N=16
0.2
0.4
0.6
0.8
1
30
210
60
240
90
270
120
300
150
330
180 0
0.2
0.4
0.6
0.8
1
30
210
60
240
90
270
120
300
150
330
180 0
Observation: As the number of isotropic antennas increase, the
directivity increases.
Case 2: When N=2, α=0°
d=λ/4 d=λ/2
0.2
0.4
0.6
0.8
1
30
210
60
240
90
270
120
300
150
330
180 0
0.2
0.4
0.6
0.8
1
30
210
60
240
90
270
120
300
150
330
180 0
27
d=3/4λ d=λ
0.2
0.4
0.6
0.8
1
30
210
60
240
90
270
120
300
150
330
180 0
0.2
0.4
0.6
0.8
1
30
210
60
240
90
270
120
300
150
330
180 0
d=5/2λ d=3/2λ
0.2
0.4
0.6
0.8
1
30
210
60
240
90
270
120
300
150
330
180 0
0.2
0.4
0.6
0.8
1
30
210
60
240
90
270
120
300
150
330
180 0
Observation: As the distance between antennas increases, the radiation
pattern is not only broadsided but also radiates in other directions.
28
Case 3: When N=2, d=λ/2
α=0° α=45°
0.2
0.4
0.6
0.8
1
30
210
60
240
90
270
120
300
150
330
180 0
0.2
0.4
0.6
0.8
1
30
210
60
240
90
270
120
300
150
330
180 0
α=90° α=135°
0.2
0.4
0.6
0.8
1
30
210
60
240
90
270
120
300
150
330
180 0
0.2
0.4
0.6
0.8
1
30
210
60
240
90
270
120
300
150
330
180 0
Observation: As the phase difference between the excitation increases,
the main lobe directivity is decreasing whereas the side lobe is increasing.
CONCLUSIONS :
29
Practical - 9
AIM : To perform the numerical evaluation of directivity for a half wave
dipole .
THEORY :
30
MATLAB PROGRAM :
% sum=0.0;
N=input(’Enter the number of segments in the theta
directionn’);
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 :
Enter number of segments in the theta direction
5
D =
1.6428
Enter number of segments in the theta direction
10
D =
1.6410
Enter number of segments in the theta direction
15
D =
1.6409
Enter number of segments in the theta direction
20
D =
1.6409
CONCLUSIONS:
31
Practical - 10
AIM : To write a program to determine the directivity [D(θ,Φ)], the
beam solid angle ΩA and the maximum directivity [Do] of an
antenna defined by F(θ,Φ) = sin2
θcos2
θ.
THEORY :
32
33
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 :
0.5
1
1.5
2
30
210
60
240
90
270
120
300
150
330
180 0
CONCLUSIONS :
34
Practical - 11
AIM : To write a program to Design Microstrip Antenna.
THEORY :
35
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_eff-
0.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 :
36
Practical - 12
AIM : To write a program to plot 3-D pattern of Rectangular Apertures
as a function of the independent variables vx, vy, for aperture
dimensions a = 8λ and b = 4λ.
THEORY :
37
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 :
-10
-5
0
5
10
-4
-2
0
2
4
0
0.2
0.4
0.6
0.8
1
CONCLUSIONS :
38
Practical - 13
AIM : To write a program to plot 3-D pattern of Circular Aperture as a
function of the independent variables vx = (a/λ)sinθcosφ and vy
= (a/λ)sinθsinφ, for an aperture radius of a = 3λ.
THEORY :
39
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 :
-4
-2
0
2
4
-4
-2
0
2
4
0
0.2
0.4
0.6
0.8
1
CONCLUSIONS :
40
Practical - 14
AIM : To write a program to plot the radiation pattern of a horn
antenna.
THEORY :
41
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);
42
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);
43
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;
44
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;
45
return
end
end
OUTPUT :
E-Plane and H-Plane Horn Specifications
directivity =
18.827820259174445
0 50 100 150 200 250 300 350
-60
-50
-40
-30
-20
-10
0
Theta (degrees)
FieldPattern(dB)
Horn Analysis
E-Plane
H-Plane
46
20
40
60
80
100
30
210
60
240
90
270
120
300
150
330
180 0
Field patterns
E-plane
H-plane
CONCLUSIONS :
47
Practical - 15
AIM : To write a program to plot the radiation pattern of a Optimized
six-element Yagi-Uda antenna.
THEORY :
48
Chen and Cheng, applied King’s three-term current approximation and
devised procedures for optimizing the choices of the antenna lengths and
separations of Yagi-Uda arrays. The gains before and after optimization of
a six-element Yagi-Uda array were calculated with the functions yagi and
gain2s. The antenna radii were a = 0.003369λ. For the unoptimized case,
the antenna lengths and x-locations were in units of λ: L = [L1, L2, L3,
L4, L5, L6]= [0.510, 0.490, 0.430, 0.430, 0.430, 0.430] d = [x1, x2, x3,
x4, x5, x6]= [−0.25, 0, 0.310, 0.620, 0.930, 1.240]. The directors were
identical and equally spaced at spacing of 0.31λ. The computed directivity
and front/back ratio were 11 dB and 9.84 dB, respectively. The optimized
case has slightly different lengths and x-locations: L = [L1, L2, L3, L4, L5,
L6]= [0.476, 0.452, 0.436, 0.430, 0.434, 0.430] d = [x1, x2, x3, x4, x5,
x6]= [−0.25, 0, 0.289, 0.695, 1.018, 1.440]. The optimized directivity
was 12.54 dB and the forward/backward ratio 17.6 dB.
MATLAB PROGRAM :
% clear all;
clc;
L = [0.476, 0.452, 0.436, 0.430, 0.434, 0.430];
a = 0.003369 * [1,1,1,1,1,1];
d = [-0.25, 0, 0.289, 0.695, 1.018, 1.440];
[I,D,Rfb] = yagi(L,a,d);
[ge,gh,th] = gain2(L,d,I,360);
figure; dbz2(th,gh,30,40);
figure; dbp2(th,ge,30,40);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% yagi.m - simplified Yagi-Uda array design
%
% Usage: [I,D,Rfb] = yagi(L,a,d)
%
% L = dipole lengths (in wavelengths) = [L1,L2,..,LK]
% a = dipole diameters = [a1,a2,...,aK]
% d = dipole locations along x-axis = [d1,d2,...,dK]
%
% I = input currents on dipoles = [I1,I2,...,IK]
% D = directivity in absolute units
% Rfb = forward-backward ratio in absolute units
%
% notes: dipole 1 is the reflector,
% dipole 2 is the driving element,
% dipoles 3:K are the directors (K>=3)
%
% current on p-th dipole is assumed to be sinusoidal:
I(p)*sin(2*pi(L(p)/2 - z)),
% this assumption is approximately correct if all the
lengths are near lambda/2,
% none of the lengths should be a multiple of lambda.
%
49
% 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); % must have three or
more antennas, K>=3
Z = impedmat(L,a,d); % mutual impedance
matrix for the yagi array
V = [0; 1; zeros(K-2,1)]; % driving voltage
V(2) = 1
I = Z  V; % solve Z*I = V
Nint = 16; % number of Gauss-
Legendre quadrature points
[wth,th] = quadr(0,pi,Nint); % quadrature weights
and angle points
[wph,ph] = quadr(0,2*pi,Nint);
A = zeros(Nint,Nint); % matrix of values
of array factor
Af = 0;
Ab = 0;
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); % forward
endfire
Ab = Ab + I(p) * F(h(p),d(p),pi/2,pi); % backward
endfire
end
Rfb = abs(Af/Ab)^2; % forward-backward
ratio
A = A / Af;
g = abs(A.*A); % normalized gain
for m=1:Nint,
50
g(:,m) = g(:,m).*sin(th); % sin(th) comes from
dOmega = sin(th)*dth*dph
end
DOm = wth' * g * wph; % integrate over
th,ph to get beam solid angle
D = 4*pi / DOm; % directivity
% --------------------------------------------------------------
-------------------
function A = F(h,d,th,ph) % array factor of
dipole at distance x=d
k = 2*pi;
th = th(:); % theta is a column
ph = ph(:)'; % phi is a row
G = zeros(length(th),1); % G(th) is column of
dipole pattern values
i = find(th~=0 & th~=pi);
G(i) = (cos(k*h*cos(th(i))) - cos(k*h)) ./ (sin(k*h) *
sin(th(i)));
A = exp(j*k*d*sin(th)*cos(ph)); % displacement phase
factors
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)
%
51
% ge,gh = E-plane/H-plane gains at (N+1) polar or azimuthal
angles over [0,2*pi]
% th = (N+1) equally-spaced polar or azimuthal angles over
[0,2*pi] in radians
%
% notes: I = [I1,I2,...,IK] are the input currents on the K
antennas,
% the current distributions on the antennas are assumed
to sinusoidal,
% for example, on the p-th antenna, Ip(z) = Ip *
sin(k*(Lp/2-abs(z))).
%
% d is the matrix of the [x,y] locations of the antennas
and is Kx2, that is,
% d = [x1,y1; x2,y2; ...; xK,yK]. If the antennas are
along the x-axis then
% d is the vector of x-coordinates only and can be
entered either as a column
% or row vector, d=[x1,x2,...,xK].
%
% E-plane gain is evaluated at phi = ph0 for 0 <= theta
<= 2*pi. The range
% [0,pi] corresponds to the forward ph0-direction and the
range [pi,2*pi] to the
% backward (ph0+pi)-direction. The E-plane gain must be
plotted with DBP2 or ABP2.
%
% H-plane gain is evaluated at theta = pi/2 for 0 <= phi
<= 2*pi and must be
% plotted with DBZ2 or ABZ2.
%
% The input currents I can be obtained from the input
driving voltages
% V = [V1,V2,...,VK]' by I = ZV, where Z is the mutual
impedance matrix
% obtained from IMPEDMAT, Z = impedmat(L,a,d), (a=antenna
diameters).
%
% for an isotropic array, use L=[0,0,...,0]
function [ge,gh,th] = gain2(L,d,I,N,ph0)
if nargin==0, help gain2; return; end
if nargin==4, ph0=0; end
I = I(:); % U(th,phi)
expects I,L to be columns
L = L(:);
K = length(L);
52
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)]; % make d
into [x,y] pairs
end
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)); % here th is
the azimuthal angle
end
ge = ge/max(ge);
gh = gh/max(gh);
% --------------------------------------------------------------
--------------
function G = U(L,d,I,th,phi) % radiation
intensity U(th,phi)
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)) .* (exp(j*kx*x).*exp(j*ky*y)); % K-
dimensional array factor
if sin(th)==0, % gains of
antenna elements
F = zeros(length(L),1); % F is K-
dimensional column
else
F = (cos(k*L*cos(th)/2) - cos(k*L/2)) / sin(th);
end
if max(L)==0, % isotropic
array case
F = ones(K,1);
53
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 nargin==0, help dbz2; return; end
if nargin<3, rays = 30; end
if nargin<4, Rm = 40; end
if nargin<5, width = 1; end
sty = ':'; % grid
line style
54
gdb = g .* (g > eps) + eps * (g <= eps); % make g=0
into g=eps, avoids -Inf's
gdb = 10 * log10(gdb);
gdb = gdb .* (gdb > -Rm) + (-Rm) * (gdb <= -Rm); % lowest
is Rm dB
gdb = (gdb + Rm)/Rm; % scale to
unity max.
x = gdb .* cos(phi);
y = gdb .* sin(phi);
N0 = 400;
phi0 = (0:N0) * 2*pi / N0;
x0 = sin(phi0); % gain
circles
y0 = cos(phi0);
h = plot(x, y, 'LineWidth', width);
hold on;
plot(x0, y0, 0.75*x0, 0.75*y0, sty, 0.50*x0, 0.50*y0, sty,
0.25*x0, 0.25*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', 'fontsize', Nf, 'horiz', 'center',
'vert', 'bottom');
text(0, -0.99, '-90^o', 'fontsize', Nf, 'horiz', 'center',
'vert', 'top');
text(1, 0.01, ' 0^o', 'fontsize', Nf, 'horiz', 'left', 'vert',
'middle');
text(-1.02, 0.01, '180^o', 'fontsize', Nf, 'horiz', 'right',
'vert', 'middle');
text(1.07*cos(pi/12), 1.07*sin(pi/12), 'phi', 'fontsize',
Nf+2, 'horiz', 'left');
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);
55
text(1.04*x1, y1, '45^o', 'fontsize', Nf, 'horiz',
'left', 'vert', 'bottom');
text(0.97*x1, -0.97*y1, '-45^o', 'fontsize', Nf, 'horiz',
'left', 'vert', 'top');
text(-0.97*x1, 1.02*y1, '135^o', 'fontsize', Nf, 'horiz',
'right', 'vert', 'bottom');
text(-1.01*x1, -1.01*y1, '-135^o', 'fontsize', Nf, 'horiz',
'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', 'fontsize', Nf,
'horiz', 'left', 'vert', 'bottom');
text(0.95*x1,-0.97*y1, '-60^o', 'fontsize', Nf,
'horiz', 'left', 'vert', 'top');
text(1.04*x2,0.97*y2, '30^o', 'fontsize', Nf, 'horiz', 'left',
'vert', 'bottom');
text(0.98*x2,-0.93*y2, '-30^o', 'fontsize', Nf,
'horiz', 'left', 'vert', 'top');
text(-0.91*x1,1.02*y1, '120^o', 'fontsize', Nf, 'horiz',
'right', 'vert', 'bottom');
text(-0.97*x1,-1.01*y1, '-120^o', 'fontsize', Nf, 'horiz',
'right', 'vert', 'top');
text(-1.02*x2,0.97*y2, '150^o', 'fontsize', Nf, 'horiz',
'right', 'vert', 'bottom');
text(-1.01*x2,-1.01*y2, '-150^o', 'fontsize', Nf, 'horiz',
'right', 'vert', 'top');
end
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, 'dB', 'fontsize', Nf, 'horiz', 'left',
'vert', 'top');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
56
% dbp2.m - polar gain plot in dB - 2*pi angle range
%
% Usage: h = dbp2(th, g, rays, Rm, width)
% h = dbp2(th, g) (equivalent to rays=30,
Rm=40, width=1)
% h = dbp2(th, g, rays) (equivalent to Rm=40,
width=1)
% h = dbp2(th, g, rays, Rm) (equivalent to width=1)
%
% th = polar angles over [0,pi]
% g = gain at th (g is in absolute units)
% rays = ray grid at 30 degree (default) or at 45 degree angles
% Rm = minimum dB level (Rm = 40 dB by default)
% width = linewidth of gain curve (width=1 by default)
%
% h = handle to use for adding more gains and legends (see
DBADD)
%
% examples: dbp2(th, g); default (30-degree lines
and 40-dB scale)
% dbp2(th, g, 45); use 45-degree grid lines
% dbp2(th, g, 30, 60); 30-degree rays and 60-dB
scale
% dbp2(th, g, 30, 60, 1.5); use thicker line for
gain
%
% notes: makes polar plot of gdb=10*log10(g) versus th,
%
%
% max-g is assumed to be unity (e.g., as in the output of
ARRAY),
% grid circles at Rm/4, 2Rm/4, 3Rm/4 are added and
labeled,
% for EPS output, use width=1.50 for thicker gain line
(thinnest width=0.75)
%
function h = dbp(th, g, rays, Rm, width)
if nargin==0, help dbp; return; end
if nargin<3, rays = 30; end
if nargin<4, Rm = 40; end
if nargin<5, width = 1; end
sty = ':'; % grid line
style
gdb = g .* (g > eps) + eps * (g <= eps); % make g=0
into g=eps, avoids -Inf's
gdb = 10 * log10(gdb);
57
gdb = gdb .* (gdb > -Rm) + (-Rm) * (gdb <= -Rm); % lowest is
-Rm dB
gdb = (gdb + Rm)/Rm; % scale to
unity max.
x = gdb .* sin(th); % x-axis
plotted vertically
y = gdb .* cos(th);
N0 = 400;
phi0 = (0:N0) * 2*pi / N0;
x0 = sin(phi0); % gain
circles
y0 = cos(phi0);
h = plot(x, y, 'LineWidth', width);
hold on;
plot(x0, y0, 0.75*x0, 0.75*y0, sty, 0.50*x0, 0.50*y0, sty,
0.25*x0, 0.25*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', 'fontsize', Nf, 'horiz', 'center',
'vert', 'bottom');
text(0, -0.99, ' 180^o', 'fontsize', Nf, 'horiz', 'center',
'vert', 'top');
text(1, 0.01, ' 90^o', 'fontsize', Nf, 'horiz', 'left', 'vert',
'middle');
text(-1.02, 0.01, '90^o', 'fontsize', Nf, 'horiz', 'right',
'vert', 'middle');
text(1.07*cos(5*pi/12), 1.07*sin(5*pi/12), 'theta',
'fontsize', Nf+2, 'horiz', 'left');
text(-1.07*cos(5*pi/12), 1.07*sin(5*pi/12), 'theta',
'fontsize', Nf+2, 'horiz', 'right');
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);
58
text(1.04*x1, y1, '45^o', 'fontsize', Nf, 'horiz',
'left', 'vert', 'bottom');
text(0.98*x1, -0.98*y1, '135^o', 'fontsize', Nf, 'horiz',
'left', 'vert', 'top');
text(-0.97*x1, 1.02*y1, '45^o', 'fontsize', Nf, 'horiz',
'right', 'vert', 'bottom');
text(-1.01*x1, -1.01*y1, '135^o', 'fontsize', Nf, 'horiz',
'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, '30^o', 'fontsize', Nf, 'horiz',
'left', 'vert', 'bottom');
text(0.96*x1,-0.98*y1, '150^o', 'fontsize', Nf, 'horiz',
'left', 'vert', 'top');
text(1.04*x2,0.97*y2, '60^o', 'fontsize', Nf, 'horiz',
'left', 'vert', 'bottom');
text(x2,-0.95*y2, '120^o', 'fontsize', Nf, 'horiz',
'left', 'vert', 'top');
text(-0.91*x1,1.02*y1, '30^o', 'fontsize', Nf, 'horiz',
'right', 'vert', 'bottom');
text(-0.97*x1,-1.01*y1, '150^o', 'fontsize', Nf, 'horiz',
'right', 'vert', 'top');
text(-1.02*x2,0.97*y2, '60^o', 'fontsize', Nf, 'horiz',
'right', 'vert', 'bottom');
text(-1.01*x2,-1.01*y2, '120^o', 'fontsize', Nf, 'horiz',
'right', 'vert', 'top');
end
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, 'dB', 'fontsize', Nf, 'horiz', 'left',
'vert', 'top');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
59
OUTPUT :
90o
-90o
0o
180o

60o
-60o
30o
-30o
120o
-120o
150o
-150o
-10-20-30
dB
0o
180o
90o
90o
 30o
150o
60o
120o
30o
150o
60o
120o
-10-20-30
dB
CONCLUSIONS :
60
Practical - 16
AIM : To write a program to plot the radiation pattern for Binomial
antenna array.
THEORY :
61
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= (k.*d.*cosd(theta)) + beta;
AF= (1+exp(1j.*(deg2rad(psi)))).^(N-1);
AE= (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;
62
OUTPUT :
Elapsed time is 0.572803 seconds.
0.5
1
30
210
60
240
90
270
120
300
150
330
180 0
50
100
30
210
60
240
90
270
120
300
150
330
180 0
50
100
30
210
60
240
90
270
120
300
150
330
180 0
Binomial array
CONCLUSIONS :
63
Practical - 17
AIM : To write a program to plot radiation pattern for Broadside antenna
array.
THEORY :
64
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= input('nEnter the number of Elements::->');
d= input('nEnter the distance between the elements::->');
k= 360;
c= (k.*d)./2;
%%CALCULATING ARRAY FACTOR AND ARRAY ELEMENT...
num= ((1./N).*sind(N.*c.*cosd(theta)));
den= sind(c.*cosd(theta));
AF = num./den;
AE = (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;
65
OUTPUT :
Enter the number of Elements::->5
Enter the distance between the elements::->0.5
Elapsed time is 11.856490 seconds.
0.5
1
30
210
60
240
90
270
120
300
150
330
180 0
0.5
1
30
210
60
240
90
270
120
300
150
330
180 0
0.5
1
30
210
60
240
90
270
120
300
150
330
180 0
Broadside array
CONCLUSIONS :
66
Practical - 18
AIM : To write a program to plot radiation pattern for Endfire antenna
array.
THEORY :
67
MATLAB PROGRAM :
% clear;
clc;
tic;
%%Initialisation
%AF = zeros(1,360);
%AE = zeros(1,360);
theta=1:360;
%%ACCEPTING INPUTS..
N= input('nEnter the number of Elements::->');
d= input('nEnter the distance between the elements::->');
k= 360;
c= (k.*d)./2;
%%CALCULATING ARRAY FACTOR AND ARRAY ELEMENT...
num= ((1./N).*sind(N.*c.*(cosd(theta)+1)));
den= sind(c.*(cosd(theta)+1));
AF= num./den;
AE= (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;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
68
OUTPUT :
Enter the number of Elements::->5
Enter the distance between the elements::->0.5
Elapsed time is 6.356738 seconds.
0.5
1
30
210
60
240
90
270
120
300
150
330
180 0
0.5
1
30
210
60
240
90
270
120
300
150
330
180 0
0.5
1
30
210
60
240
90
270
120
300
150
330
180 0
Endfire array
CONCLUSIONS :
69
Practical - 19
AIM : To write a program to plot 3D radiation pattern for Binomial
antenna array.
THEORY :
70
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)) + beta;
AF = (1+exp(1j.*(psi))).^(N-1);
AF = 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,abs(AE));
surf(x1,y1,z1,'FaceLighting','phong',...
'LineStyle','none',...
'FaceColor',[1 0 0]);
71
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 :
Enter the number of Elements::(eg., 5,6,7,etc)->6
Enter the distance between the elements::(eg.,0.4,0.5,etc)-
>0.5
Elapsed time is 0.056854 seconds.
72
CONCLUSIONS :
73
Practical - 20
AIM : To write a program to plot 3D radiation pattern for Broadside
antenna array.
THEORY :
74
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 = ((1./N).*sin(N.*c.*cos(theta)));
den = sin(c.*cos(theta));
AF = num./den;
AF = 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
75
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]);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%
76
OUTPUT :
Enter the number of Elements::(eg., 5,6,7,etc)->6
Enter the distance between the elements::(eg.,0.4,0.5,etc)-
>0.5
Elapsed time is 0.173608 seconds.
CONCLUSIONS :
77
Practical - 21
AIM : To write a program to plot 3D radiation pattern for Endfire
antenna array
THEORY :
78
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 = num./den;
AF = 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')
79
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 :
Enter the number of Elements::(eg., 5,6,7,etc)->6
Enter the distance between the elements::(eg.,0.4,0.5,etc)-
>0.5
Elapsed time is 0.136698 seconds.
80
CONCLUSIONS :
81
Practical - 22
AIM : To write a program to plot 3-D Radiation Pattern of Dipole
Antenna.
THEORY :
82
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
83
% converting to spherical coordinates
[x,y,z]=sph2cart(phi,theta,U);
%plotting routine
surf(x,y,z)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
OUTPUT :
-40
-20
0
20
40
-40
-20
0
20
40
-30
-20
-10
0
10
20
30
CONCLUSIONS :

More Related Content

What's hot

Antenna presentation PPT
Antenna presentation PPTAntenna presentation PPT
Antenna presentation PPTSachin Kadam
 
ANTENNA AND ITS TYPES
ANTENNA  AND ITS TYPESANTENNA  AND ITS TYPES
ANTENNA AND ITS TYPESSurbhi Sharma
 
LED and LASER source in optical communication
LED and LASER source in optical communicationLED and LASER source in optical communication
LED and LASER source in optical communicationbhupender rawat
 
Broadband antennas
Broadband antennasBroadband antennas
Broadband antennasAJAL A J
 
MicroStrip Antenna
MicroStrip AntennaMicroStrip Antenna
MicroStrip AntennaTarek Nader
 
Antennas wave and propagation
 Antennas wave and propagation Antennas wave and propagation
Antennas wave and propagationIsha Negi
 
Equal Split Wilkinson Power Divider - Project Report
Equal Split Wilkinson Power Divider - Project ReportEqual Split Wilkinson Power Divider - Project Report
Equal Split Wilkinson Power Divider - Project ReportBhanwar Singh Meena
 
Antenna arrays
Antenna arraysAntenna arrays
Antenna arraysAJAL A J
 
Half wave dipole antenna
Half wave dipole antennaHalf wave dipole antenna
Half wave dipole antennaRoshan Kattel
 
Dipole antenna
Dipole antennaDipole antenna
Dipole antennamahendra v
 
Concept of Diversity & Fading (wireless communication)
Concept of Diversity & Fading (wireless communication)Concept of Diversity & Fading (wireless communication)
Concept of Diversity & Fading (wireless communication)Omkar Rane
 
Digital satellite communications
Digital satellite communicationsDigital satellite communications
Digital satellite communicationsNisreen Bashar
 
HFSS MICROSTRIP PATCH ANTENNA- ANALYSIS AND DESIGN
HFSS MICROSTRIP PATCH ANTENNA- ANALYSIS AND DESIGNHFSS MICROSTRIP PATCH ANTENNA- ANALYSIS AND DESIGN
HFSS MICROSTRIP PATCH ANTENNA- ANALYSIS AND DESIGNShivashu Awasthi
 
Two cavity klystron
Two cavity klystronTwo cavity klystron
Two cavity klystronabhikalmegh
 
Log periodic antenna
Log periodic antennaLog periodic antenna
Log periodic antennaKeval Patel
 

What's hot (20)

Antenna presentation PPT
Antenna presentation PPTAntenna presentation PPT
Antenna presentation PPT
 
Antenna Basics
Antenna BasicsAntenna Basics
Antenna Basics
 
ANTENNA AND ITS TYPES
ANTENNA  AND ITS TYPESANTENNA  AND ITS TYPES
ANTENNA AND ITS TYPES
 
LED and LASER source in optical communication
LED and LASER source in optical communicationLED and LASER source in optical communication
LED and LASER source in optical communication
 
Broadband antennas
Broadband antennasBroadband antennas
Broadband antennas
 
MicroStrip Antenna
MicroStrip AntennaMicroStrip Antenna
MicroStrip Antenna
 
Antennas wave and propagation
 Antennas wave and propagation Antennas wave and propagation
Antennas wave and propagation
 
Equal Split Wilkinson Power Divider - Project Report
Equal Split Wilkinson Power Divider - Project ReportEqual Split Wilkinson Power Divider - Project Report
Equal Split Wilkinson Power Divider - Project Report
 
Antenna arrays
Antenna arraysAntenna arrays
Antenna arrays
 
Half wave dipole antenna
Half wave dipole antennaHalf wave dipole antenna
Half wave dipole antenna
 
Dipole antenna
Dipole antennaDipole antenna
Dipole antenna
 
Trapatt diode
Trapatt diodeTrapatt diode
Trapatt diode
 
waveguides-ppt
waveguides-pptwaveguides-ppt
waveguides-ppt
 
Concept of Diversity & Fading (wireless communication)
Concept of Diversity & Fading (wireless communication)Concept of Diversity & Fading (wireless communication)
Concept of Diversity & Fading (wireless communication)
 
Multiple Access
Multiple AccessMultiple Access
Multiple Access
 
Digital satellite communications
Digital satellite communicationsDigital satellite communications
Digital satellite communications
 
HFSS MICROSTRIP PATCH ANTENNA- ANALYSIS AND DESIGN
HFSS MICROSTRIP PATCH ANTENNA- ANALYSIS AND DESIGNHFSS MICROSTRIP PATCH ANTENNA- ANALYSIS AND DESIGN
HFSS MICROSTRIP PATCH ANTENNA- ANALYSIS AND DESIGN
 
Two cavity klystron
Two cavity klystronTwo cavity klystron
Two cavity klystron
 
Log periodic antenna
Log periodic antennaLog periodic antenna
Log periodic antenna
 
array and phased array antennna
array and phased array antennnaarray and phased array antennna
array and phased array antennna
 

Similar to MATLAB Programs for Antenna Radiation Patterns

EE443 - Communications 1 - Lab 1 - Loren Schwappach.pdf
EE443 - Communications 1 - Lab 1 - Loren Schwappach.pdf EE443 - Communications 1 - Lab 1 - Loren Schwappach.pdf
EE443 - Communications 1 - Lab 1 - Loren Schwappach.pdf Loren Schwappach
 
BS LAB Manual (1).pdf
BS LAB Manual  (1).pdfBS LAB Manual  (1).pdf
BS LAB Manual (1).pdfssuser476810
 
Analysis Of Transmission Line Using MATLAB Software
Analysis Of Transmission Line Using MATLAB SoftwareAnalysis Of Transmission Line Using MATLAB Software
Analysis Of Transmission Line Using MATLAB SoftwareAllison Thompson
 
DSP_Lab_MAnual_-_Final_Edition[1].docx
DSP_Lab_MAnual_-_Final_Edition[1].docxDSP_Lab_MAnual_-_Final_Edition[1].docx
DSP_Lab_MAnual_-_Final_Edition[1].docxParthDoshi66
 
Department of Avionics Engineering The Superior University, Lahore Lab Manual...
Department of Avionics Engineering The Superior University, Lahore Lab Manual...Department of Avionics Engineering The Superior University, Lahore Lab Manual...
Department of Avionics Engineering The Superior University, Lahore Lab Manual...MIbrar4
 
DSP_Lab_MAnual_-_Final_Edition.pdf
DSP_Lab_MAnual_-_Final_Edition.pdfDSP_Lab_MAnual_-_Final_Edition.pdf
DSP_Lab_MAnual_-_Final_Edition.pdfParthDoshi66
 
Analog Communication Engineering Lab Manual
Analog Communication Engineering Lab ManualAnalog Communication Engineering Lab Manual
Analog Communication Engineering Lab ManualAmairullah Khan Lodhi
 
Digital Signal Processing Lab Manual
Digital Signal Processing Lab Manual Digital Signal Processing Lab Manual
Digital Signal Processing Lab Manual Amairullah Khan Lodhi
 
Matlab 3
Matlab 3Matlab 3
Matlab 3asguna
 
Matlab kod taslağı
Matlab kod taslağıMatlab kod taslağı
Matlab kod taslağıMerve Cvdr
 
Tao Fayan_Iso and Full_volume rendering
Tao Fayan_Iso and Full_volume renderingTao Fayan_Iso and Full_volume rendering
Tao Fayan_Iso and Full_volume renderingFayan TAO
 
Digital signal Processing all matlab code with Lab report
Digital signal Processing all matlab code with Lab report Digital signal Processing all matlab code with Lab report
Digital signal Processing all matlab code with Lab report Alamgir Hossain
 
Simulation of an adaptive digital beamformer using matlab
Simulation of an adaptive digital beamformer using matlabSimulation of an adaptive digital beamformer using matlab
Simulation of an adaptive digital beamformer using matlabIJARBEST JOURNAL
 

Similar to MATLAB Programs for Antenna Radiation Patterns (20)

DSP lab manual
DSP lab manualDSP lab manual
DSP lab manual
 
EE201_Assignment2
EE201_Assignment2EE201_Assignment2
EE201_Assignment2
 
Dsp file
Dsp fileDsp file
Dsp file
 
EE443 - Communications 1 - Lab 1 - Loren Schwappach.pdf
EE443 - Communications 1 - Lab 1 - Loren Schwappach.pdf EE443 - Communications 1 - Lab 1 - Loren Schwappach.pdf
EE443 - Communications 1 - Lab 1 - Loren Schwappach.pdf
 
BS LAB Manual (1).pdf
BS LAB Manual  (1).pdfBS LAB Manual  (1).pdf
BS LAB Manual (1).pdf
 
Analysis Of Transmission Line Using MATLAB Software
Analysis Of Transmission Line Using MATLAB SoftwareAnalysis Of Transmission Line Using MATLAB Software
Analysis Of Transmission Line Using MATLAB Software
 
dsp.pdf
dsp.pdfdsp.pdf
dsp.pdf
 
DSP_Lab_MAnual_-_Final_Edition[1].docx
DSP_Lab_MAnual_-_Final_Edition[1].docxDSP_Lab_MAnual_-_Final_Edition[1].docx
DSP_Lab_MAnual_-_Final_Edition[1].docx
 
Department of Avionics Engineering The Superior University, Lahore Lab Manual...
Department of Avionics Engineering The Superior University, Lahore Lab Manual...Department of Avionics Engineering The Superior University, Lahore Lab Manual...
Department of Avionics Engineering The Superior University, Lahore Lab Manual...
 
Analog Communication Lab Manual
Analog Communication Lab ManualAnalog Communication Lab Manual
Analog Communication Lab Manual
 
DSP_Lab_MAnual_-_Final_Edition.pdf
DSP_Lab_MAnual_-_Final_Edition.pdfDSP_Lab_MAnual_-_Final_Edition.pdf
DSP_Lab_MAnual_-_Final_Edition.pdf
 
Analog Communication Engineering Lab Manual
Analog Communication Engineering Lab ManualAnalog Communication Engineering Lab Manual
Analog Communication Engineering Lab Manual
 
Digital Signal Processing Lab Manual
Digital Signal Processing Lab Manual Digital Signal Processing Lab Manual
Digital Signal Processing Lab Manual
 
Matlab 3
Matlab 3Matlab 3
Matlab 3
 
Matlab kod taslağı
Matlab kod taslağıMatlab kod taslağı
Matlab kod taslağı
 
LMmanual.pdf
LMmanual.pdfLMmanual.pdf
LMmanual.pdf
 
Tao Fayan_Iso and Full_volume rendering
Tao Fayan_Iso and Full_volume renderingTao Fayan_Iso and Full_volume rendering
Tao Fayan_Iso and Full_volume rendering
 
lab 3.docx
lab 3.docxlab 3.docx
lab 3.docx
 
Digital signal Processing all matlab code with Lab report
Digital signal Processing all matlab code with Lab report Digital signal Processing all matlab code with Lab report
Digital signal Processing all matlab code with Lab report
 
Simulation of an adaptive digital beamformer using matlab
Simulation of an adaptive digital beamformer using matlabSimulation of an adaptive digital beamformer using matlab
Simulation of an adaptive digital beamformer using matlab
 

Recently uploaded

chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZTE
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and usesDevarapalliHaritha
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 

Recently uploaded (20)

chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and uses
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 

MATLAB Programs for Antenna Radiation Patterns

  • 1. 1 LAB MANUAL 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.)
  • 2. 2 CERTIFICATE This is to certify that __________________________________ Enrollement number ____________________ has successfully completed his/her term work and practical work in the subject Antenna and Wave Propagation(161003) for the term ending in __________________ at Government Engineering College, Dahod, for partial fulfillment of B.E. degree to be awarded by Gujarat Technological University. This work has been carried out under my supervision and is to my satisfaction. Date: Place: Subject Teacher Head of Department
  • 3. 3 INDEX NO SUBJECT DATE PAGE SIGN REMARKS 1 To write a program to plot the radiation pattern of Dipole Antenna. 2 To write a program to plot radiation pattern of Monopole antenna. 3 To write a program to plot radiation pattern of Loop antenna. 4 To write a Program to plot radiation pattern of Linear array antenna. 5 To write a Program to plot radiation pattern of Circular array antenna. 6 To write program to plot radiation pattern of rectangular aperture antenna. 7 To write a program to plot radiation pattern of travelling wave antenna. 8 To write a program to plot radiation pattern of linear array of isotropic antennas. 9 To perform the numerical evaluation of directivity for a half wave dipole. 10 To write a program to determine the directivity [D(θ,Φ)], the beam solid angle ΩA and the maximum directivity [Do] of an antenna defined by F(θ,Φ) = sin2 θcos2 θ. 11 To write a program to Design Microstrip Antenna.
  • 4. 4 12 To write a program to plot 3-D pattern of Rectangular Apertures as a function of the independent variables vx, vy, for aperture dimensions a = 8λ and b = 4λ. 13 To write a program to plot 3-D pattern of Circular Aperture as a function of the independent variables vx = (a/λ)sinθcosφ and vy = (a/λ)sinθsinφ, for an aperture radius of a = 3λ. 14 To write a program to plot the radiation pattern of a horn antenna. 15 To write a program to plot the radiation pattern of a Optimized six-element Yagi-Uda antenna. 16 To write a program to plot the radiation pattern for Binomial antenna array. 17 To write a program to plot radiation pattern for Broadside antenna array. 18 To write a program to plot radiation pattern for Endfire antenna array. 19 To write a program to plot 3D radiation pattern for Binomial antenna array. 20 To write a program to plot 3D radiation pattern for Broadside antenna array. 21 To write a program to plot 3D radiation pattern for Endfire antenna array. 22 To write a program to plot 3-D Radiation Pattern of Dipole Antenna.
  • 5. 5 Practical -1 AIM : To write a program to plot the radiation pattern of Dipole Antenna. THEORY :
  • 6. 6 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 : enter the value of wave length= 1 enter your dipole length l in terms of lamda(for ex: 0.5 for 0.5lamda)= 0.5
  • 8. 8 Practical - 2 AIM : To write a program to plot radiation pattern of Monopole antenna. THEORY :
  • 9. 9 MATLAB PROGRAM : %%This program print pattern for Short and any monopole %Antenna by giving the length of your Dipole %and the wavelength you work with lamda=input('enter the value of wave length= '); l=input('enter your monopole length l= '); ratio=l/lamda; B=(2*pi/lamda); theta= -pi/2:pi/100:pi/2; if ratio<= 0.1 %check if Short monopole E=sin(theta); En=abs(E); polar(theta,En) %This plot polar pattern in plane which monopole appear as line else %check if not short monopole 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 monopole appear as line end OUTPUT : enter the value of wave length= 1 enter your monopole length l= 0.5
  • 11. 11 Practical -3 AIM : To write a program to plot radiation pattern of Loop antenna. THEORY :
  • 12. 12 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 0.2 0.4 0.6 30 210 60 240 90 270 120 300 150 330 180 0 CONCLUSIONS :
  • 13. 13 Practical - 4 AIM : To write a Program to plot radiation pattern of Linear array antenna. THEORY :
  • 14. 14 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 the value of wave length= 1 enter the no. of elements(3,4,5...)= 6 enter your progressive phase(alpha=0,45...)= 0 enter the seperation distance between elements(in terms of lamda for ex: 0.3 for 0.3lamda)= 0.3
  • 16. 16 Practical - 5 AIM : To write a Program to plot radiation pattern of Circular array antenna. THEORY :
  • 17. 17 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 : enter the value of wave length= 1 enter the no. of elements(3,4,5...)= 2 enter your circular radius( in terms of lamda for ex 0.2 for 0.2lamda)= 0.2 enter angle theta at which main lobe occurs(ex: 45)= 45 enter angle phi at which main lobe occurs(ex: 90)= 90
  • 19. 19 Practical - 6 AIM : To write program to plot radiation pattern of rectangular aperture antenna. THEORY :
  • 20. 20 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= ');
  • 21. 21 f1=B*a; f=f1.*(sin(theta)); E=(besselj(1,f))./f; %E-plane or H-plane subplot(3,3,7) polar(theta,E) end OUTPUT : Enter your antenna type Rectangular (1) or circular (2)= 1 enter the value of wave length= 1 enter your feeding type "uniform(1),blocked in one dim. Aperture(2),TE10(3)": 1 enter ur larg rectanglar length a= 0.3 enter ur small rectanglar length b= 0.2 0.5 1 30 210 60 240 90 270 120 300 150 330 180 0 E-plane 0.5 1 30 210 60 240 90 270 120 300 150 330 180 0 H-plane CONCLUSIONS :
  • 22. 22 Practical - 7 AIM : To write a program to plot radiation pattern of travelling wave antenna. THEORY :
  • 23. 23 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 0.5 1 1.5 2 30 210 60 240 90 270 120 300 150 330 180 0 CONCLUSIONS :
  • 24. 24 Practical - 8 AIM : To write a program to plot radiation pattern of linear array of isotropic antennas. THEORY :
  • 25. 25 MATLAB PROGRAM : % clc; lamda=input('enter the value of wave length(in meter)= '); N=input('enter the no. of elements= '); alpha=input('enter your progressive phase= '); d=input('enter the separation distance between elements(in meter)= '); beta=(2*pi/lamda); theta= pi/100:pi/100:2*pi; psi=alpha+beta*d.*cos(theta); e=sin(N*(psi./2))./sin(psi./2); polar(theta,e/N); Case 1: When α=0, d=λ/4 N=2 N=4 0.2 0.4 0.6 0.8 1 30 210 60 240 90 270 120 300 150 330 180 0 0.2 0.4 0.6 0.8 1 30 210 60 240 90 270 120 300 150 330 180 0
  • 26. 26 N=8 N=16 0.2 0.4 0.6 0.8 1 30 210 60 240 90 270 120 300 150 330 180 0 0.2 0.4 0.6 0.8 1 30 210 60 240 90 270 120 300 150 330 180 0 Observation: As the number of isotropic antennas increase, the directivity increases. Case 2: When N=2, α=0° d=λ/4 d=λ/2 0.2 0.4 0.6 0.8 1 30 210 60 240 90 270 120 300 150 330 180 0 0.2 0.4 0.6 0.8 1 30 210 60 240 90 270 120 300 150 330 180 0
  • 27. 27 d=3/4λ d=λ 0.2 0.4 0.6 0.8 1 30 210 60 240 90 270 120 300 150 330 180 0 0.2 0.4 0.6 0.8 1 30 210 60 240 90 270 120 300 150 330 180 0 d=5/2λ d=3/2λ 0.2 0.4 0.6 0.8 1 30 210 60 240 90 270 120 300 150 330 180 0 0.2 0.4 0.6 0.8 1 30 210 60 240 90 270 120 300 150 330 180 0 Observation: As the distance between antennas increases, the radiation pattern is not only broadsided but also radiates in other directions.
  • 28. 28 Case 3: When N=2, d=λ/2 α=0° α=45° 0.2 0.4 0.6 0.8 1 30 210 60 240 90 270 120 300 150 330 180 0 0.2 0.4 0.6 0.8 1 30 210 60 240 90 270 120 300 150 330 180 0 α=90° α=135° 0.2 0.4 0.6 0.8 1 30 210 60 240 90 270 120 300 150 330 180 0 0.2 0.4 0.6 0.8 1 30 210 60 240 90 270 120 300 150 330 180 0 Observation: As the phase difference between the excitation increases, the main lobe directivity is decreasing whereas the side lobe is increasing. CONCLUSIONS :
  • 29. 29 Practical - 9 AIM : To perform the numerical evaluation of directivity for a half wave dipole . THEORY :
  • 30. 30 MATLAB PROGRAM : % sum=0.0; N=input(’Enter the number of segments in the theta directionn’); 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 : Enter number of segments in the theta direction 5 D = 1.6428 Enter number of segments in the theta direction 10 D = 1.6410 Enter number of segments in the theta direction 15 D = 1.6409 Enter number of segments in the theta direction 20 D = 1.6409 CONCLUSIONS:
  • 31. 31 Practical - 10 AIM : To write a program to determine the directivity [D(θ,Φ)], the beam solid angle ΩA and the maximum directivity [Do] of an antenna defined by F(θ,Φ) = sin2 θcos2 θ. THEORY :
  • 32. 32
  • 33. 33 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 : 0.5 1 1.5 2 30 210 60 240 90 270 120 300 150 330 180 0 CONCLUSIONS :
  • 34. 34 Practical - 11 AIM : To write a program to Design Microstrip Antenna. THEORY :
  • 35. 35 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_eff- 0.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 :
  • 36. 36 Practical - 12 AIM : To write a program to plot 3-D pattern of Rectangular Apertures as a function of the independent variables vx, vy, for aperture dimensions a = 8λ and b = 4λ. THEORY :
  • 37. 37 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 : -10 -5 0 5 10 -4 -2 0 2 4 0 0.2 0.4 0.6 0.8 1 CONCLUSIONS :
  • 38. 38 Practical - 13 AIM : To write a program to plot 3-D pattern of Circular Aperture as a function of the independent variables vx = (a/λ)sinθcosφ and vy = (a/λ)sinθsinφ, for an aperture radius of a = 3λ. THEORY :
  • 39. 39 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 : -4 -2 0 2 4 -4 -2 0 2 4 0 0.2 0.4 0.6 0.8 1 CONCLUSIONS :
  • 40. 40 Practical - 14 AIM : To write a program to plot the radiation pattern of a horn antenna. THEORY :
  • 41. 41 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);
  • 42. 42 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);
  • 43. 43 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;
  • 44. 44 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;
  • 45. 45 return end end OUTPUT : E-Plane and H-Plane Horn Specifications directivity = 18.827820259174445 0 50 100 150 200 250 300 350 -60 -50 -40 -30 -20 -10 0 Theta (degrees) FieldPattern(dB) Horn Analysis E-Plane H-Plane
  • 47. 47 Practical - 15 AIM : To write a program to plot the radiation pattern of a Optimized six-element Yagi-Uda antenna. THEORY :
  • 48. 48 Chen and Cheng, applied King’s three-term current approximation and devised procedures for optimizing the choices of the antenna lengths and separations of Yagi-Uda arrays. The gains before and after optimization of a six-element Yagi-Uda array were calculated with the functions yagi and gain2s. The antenna radii were a = 0.003369λ. For the unoptimized case, the antenna lengths and x-locations were in units of λ: L = [L1, L2, L3, L4, L5, L6]= [0.510, 0.490, 0.430, 0.430, 0.430, 0.430] d = [x1, x2, x3, x4, x5, x6]= [−0.25, 0, 0.310, 0.620, 0.930, 1.240]. The directors were identical and equally spaced at spacing of 0.31λ. The computed directivity and front/back ratio were 11 dB and 9.84 dB, respectively. The optimized case has slightly different lengths and x-locations: L = [L1, L2, L3, L4, L5, L6]= [0.476, 0.452, 0.436, 0.430, 0.434, 0.430] d = [x1, x2, x3, x4, x5, x6]= [−0.25, 0, 0.289, 0.695, 1.018, 1.440]. The optimized directivity was 12.54 dB and the forward/backward ratio 17.6 dB. MATLAB PROGRAM : % clear all; clc; L = [0.476, 0.452, 0.436, 0.430, 0.434, 0.430]; a = 0.003369 * [1,1,1,1,1,1]; d = [-0.25, 0, 0.289, 0.695, 1.018, 1.440]; [I,D,Rfb] = yagi(L,a,d); [ge,gh,th] = gain2(L,d,I,360); figure; dbz2(th,gh,30,40); figure; dbp2(th,ge,30,40); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % yagi.m - simplified Yagi-Uda array design % % Usage: [I,D,Rfb] = yagi(L,a,d) % % L = dipole lengths (in wavelengths) = [L1,L2,..,LK] % a = dipole diameters = [a1,a2,...,aK] % d = dipole locations along x-axis = [d1,d2,...,dK] % % I = input currents on dipoles = [I1,I2,...,IK] % D = directivity in absolute units % Rfb = forward-backward ratio in absolute units % % notes: dipole 1 is the reflector, % dipole 2 is the driving element, % dipoles 3:K are the directors (K>=3) % % current on p-th dipole is assumed to be sinusoidal: I(p)*sin(2*pi(L(p)/2 - z)), % this assumption is approximately correct if all the lengths are near lambda/2, % none of the lengths should be a multiple of lambda. %
  • 49. 49 % 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); % must have three or more antennas, K>=3 Z = impedmat(L,a,d); % mutual impedance matrix for the yagi array V = [0; 1; zeros(K-2,1)]; % driving voltage V(2) = 1 I = Z V; % solve Z*I = V Nint = 16; % number of Gauss- Legendre quadrature points [wth,th] = quadr(0,pi,Nint); % quadrature weights and angle points [wph,ph] = quadr(0,2*pi,Nint); A = zeros(Nint,Nint); % matrix of values of array factor Af = 0; Ab = 0; 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); % forward endfire Ab = Ab + I(p) * F(h(p),d(p),pi/2,pi); % backward endfire end Rfb = abs(Af/Ab)^2; % forward-backward ratio A = A / Af; g = abs(A.*A); % normalized gain for m=1:Nint,
  • 50. 50 g(:,m) = g(:,m).*sin(th); % sin(th) comes from dOmega = sin(th)*dth*dph end DOm = wth' * g * wph; % integrate over th,ph to get beam solid angle D = 4*pi / DOm; % directivity % -------------------------------------------------------------- ------------------- function A = F(h,d,th,ph) % array factor of dipole at distance x=d k = 2*pi; th = th(:); % theta is a column ph = ph(:)'; % phi is a row G = zeros(length(th),1); % G(th) is column of dipole pattern values i = find(th~=0 & th~=pi); G(i) = (cos(k*h*cos(th(i))) - cos(k*h)) ./ (sin(k*h) * sin(th(i))); A = exp(j*k*d*sin(th)*cos(ph)); % displacement phase factors 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) %
  • 51. 51 % ge,gh = E-plane/H-plane gains at (N+1) polar or azimuthal angles over [0,2*pi] % th = (N+1) equally-spaced polar or azimuthal angles over [0,2*pi] in radians % % notes: I = [I1,I2,...,IK] are the input currents on the K antennas, % the current distributions on the antennas are assumed to sinusoidal, % for example, on the p-th antenna, Ip(z) = Ip * sin(k*(Lp/2-abs(z))). % % d is the matrix of the [x,y] locations of the antennas and is Kx2, that is, % d = [x1,y1; x2,y2; ...; xK,yK]. If the antennas are along the x-axis then % d is the vector of x-coordinates only and can be entered either as a column % or row vector, d=[x1,x2,...,xK]. % % E-plane gain is evaluated at phi = ph0 for 0 <= theta <= 2*pi. The range % [0,pi] corresponds to the forward ph0-direction and the range [pi,2*pi] to the % backward (ph0+pi)-direction. The E-plane gain must be plotted with DBP2 or ABP2. % % H-plane gain is evaluated at theta = pi/2 for 0 <= phi <= 2*pi and must be % plotted with DBZ2 or ABZ2. % % The input currents I can be obtained from the input driving voltages % V = [V1,V2,...,VK]' by I = ZV, where Z is the mutual impedance matrix % obtained from IMPEDMAT, Z = impedmat(L,a,d), (a=antenna diameters). % % for an isotropic array, use L=[0,0,...,0] function [ge,gh,th] = gain2(L,d,I,N,ph0) if nargin==0, help gain2; return; end if nargin==4, ph0=0; end I = I(:); % U(th,phi) expects I,L to be columns L = L(:); K = length(L);
  • 52. 52 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)]; % make d into [x,y] pairs end 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)); % here th is the azimuthal angle end ge = ge/max(ge); gh = gh/max(gh); % -------------------------------------------------------------- -------------- function G = U(L,d,I,th,phi) % radiation intensity U(th,phi) 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)) .* (exp(j*kx*x).*exp(j*ky*y)); % K- dimensional array factor if sin(th)==0, % gains of antenna elements F = zeros(length(L),1); % F is K- dimensional column else F = (cos(k*L*cos(th)/2) - cos(k*L/2)) / sin(th); end if max(L)==0, % isotropic array case F = ones(K,1);
  • 53. 53 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 nargin==0, help dbz2; return; end if nargin<3, rays = 30; end if nargin<4, Rm = 40; end if nargin<5, width = 1; end sty = ':'; % grid line style
  • 54. 54 gdb = g .* (g > eps) + eps * (g <= eps); % make g=0 into g=eps, avoids -Inf's gdb = 10 * log10(gdb); gdb = gdb .* (gdb > -Rm) + (-Rm) * (gdb <= -Rm); % lowest is Rm dB gdb = (gdb + Rm)/Rm; % scale to unity max. x = gdb .* cos(phi); y = gdb .* sin(phi); N0 = 400; phi0 = (0:N0) * 2*pi / N0; x0 = sin(phi0); % gain circles y0 = cos(phi0); h = plot(x, y, 'LineWidth', width); hold on; plot(x0, y0, 0.75*x0, 0.75*y0, sty, 0.50*x0, 0.50*y0, sty, 0.25*x0, 0.25*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', 'fontsize', Nf, 'horiz', 'center', 'vert', 'bottom'); text(0, -0.99, '-90^o', 'fontsize', Nf, 'horiz', 'center', 'vert', 'top'); text(1, 0.01, ' 0^o', 'fontsize', Nf, 'horiz', 'left', 'vert', 'middle'); text(-1.02, 0.01, '180^o', 'fontsize', Nf, 'horiz', 'right', 'vert', 'middle'); text(1.07*cos(pi/12), 1.07*sin(pi/12), 'phi', 'fontsize', Nf+2, 'horiz', 'left'); 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);
  • 55. 55 text(1.04*x1, y1, '45^o', 'fontsize', Nf, 'horiz', 'left', 'vert', 'bottom'); text(0.97*x1, -0.97*y1, '-45^o', 'fontsize', Nf, 'horiz', 'left', 'vert', 'top'); text(-0.97*x1, 1.02*y1, '135^o', 'fontsize', Nf, 'horiz', 'right', 'vert', 'bottom'); text(-1.01*x1, -1.01*y1, '-135^o', 'fontsize', Nf, 'horiz', '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', 'fontsize', Nf, 'horiz', 'left', 'vert', 'bottom'); text(0.95*x1,-0.97*y1, '-60^o', 'fontsize', Nf, 'horiz', 'left', 'vert', 'top'); text(1.04*x2,0.97*y2, '30^o', 'fontsize', Nf, 'horiz', 'left', 'vert', 'bottom'); text(0.98*x2,-0.93*y2, '-30^o', 'fontsize', Nf, 'horiz', 'left', 'vert', 'top'); text(-0.91*x1,1.02*y1, '120^o', 'fontsize', Nf, 'horiz', 'right', 'vert', 'bottom'); text(-0.97*x1,-1.01*y1, '-120^o', 'fontsize', Nf, 'horiz', 'right', 'vert', 'top'); text(-1.02*x2,0.97*y2, '150^o', 'fontsize', Nf, 'horiz', 'right', 'vert', 'bottom'); text(-1.01*x2,-1.01*y2, '-150^o', 'fontsize', Nf, 'horiz', 'right', 'vert', 'top'); end 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, 'dB', 'fontsize', Nf, 'horiz', 'left', 'vert', 'top'); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  • 56. 56 % dbp2.m - polar gain plot in dB - 2*pi angle range % % Usage: h = dbp2(th, g, rays, Rm, width) % h = dbp2(th, g) (equivalent to rays=30, Rm=40, width=1) % h = dbp2(th, g, rays) (equivalent to Rm=40, width=1) % h = dbp2(th, g, rays, Rm) (equivalent to width=1) % % th = polar angles over [0,pi] % g = gain at th (g is in absolute units) % rays = ray grid at 30 degree (default) or at 45 degree angles % Rm = minimum dB level (Rm = 40 dB by default) % width = linewidth of gain curve (width=1 by default) % % h = handle to use for adding more gains and legends (see DBADD) % % examples: dbp2(th, g); default (30-degree lines and 40-dB scale) % dbp2(th, g, 45); use 45-degree grid lines % dbp2(th, g, 30, 60); 30-degree rays and 60-dB scale % dbp2(th, g, 30, 60, 1.5); use thicker line for gain % % notes: makes polar plot of gdb=10*log10(g) versus th, % % % max-g is assumed to be unity (e.g., as in the output of ARRAY), % grid circles at Rm/4, 2Rm/4, 3Rm/4 are added and labeled, % for EPS output, use width=1.50 for thicker gain line (thinnest width=0.75) % function h = dbp(th, g, rays, Rm, width) if nargin==0, help dbp; return; end if nargin<3, rays = 30; end if nargin<4, Rm = 40; end if nargin<5, width = 1; end sty = ':'; % grid line style gdb = g .* (g > eps) + eps * (g <= eps); % make g=0 into g=eps, avoids -Inf's gdb = 10 * log10(gdb);
  • 57. 57 gdb = gdb .* (gdb > -Rm) + (-Rm) * (gdb <= -Rm); % lowest is -Rm dB gdb = (gdb + Rm)/Rm; % scale to unity max. x = gdb .* sin(th); % x-axis plotted vertically y = gdb .* cos(th); N0 = 400; phi0 = (0:N0) * 2*pi / N0; x0 = sin(phi0); % gain circles y0 = cos(phi0); h = plot(x, y, 'LineWidth', width); hold on; plot(x0, y0, 0.75*x0, 0.75*y0, sty, 0.50*x0, 0.50*y0, sty, 0.25*x0, 0.25*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', 'fontsize', Nf, 'horiz', 'center', 'vert', 'bottom'); text(0, -0.99, ' 180^o', 'fontsize', Nf, 'horiz', 'center', 'vert', 'top'); text(1, 0.01, ' 90^o', 'fontsize', Nf, 'horiz', 'left', 'vert', 'middle'); text(-1.02, 0.01, '90^o', 'fontsize', Nf, 'horiz', 'right', 'vert', 'middle'); text(1.07*cos(5*pi/12), 1.07*sin(5*pi/12), 'theta', 'fontsize', Nf+2, 'horiz', 'left'); text(-1.07*cos(5*pi/12), 1.07*sin(5*pi/12), 'theta', 'fontsize', Nf+2, 'horiz', 'right'); 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);
  • 58. 58 text(1.04*x1, y1, '45^o', 'fontsize', Nf, 'horiz', 'left', 'vert', 'bottom'); text(0.98*x1, -0.98*y1, '135^o', 'fontsize', Nf, 'horiz', 'left', 'vert', 'top'); text(-0.97*x1, 1.02*y1, '45^o', 'fontsize', Nf, 'horiz', 'right', 'vert', 'bottom'); text(-1.01*x1, -1.01*y1, '135^o', 'fontsize', Nf, 'horiz', '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, '30^o', 'fontsize', Nf, 'horiz', 'left', 'vert', 'bottom'); text(0.96*x1,-0.98*y1, '150^o', 'fontsize', Nf, 'horiz', 'left', 'vert', 'top'); text(1.04*x2,0.97*y2, '60^o', 'fontsize', Nf, 'horiz', 'left', 'vert', 'bottom'); text(x2,-0.95*y2, '120^o', 'fontsize', Nf, 'horiz', 'left', 'vert', 'top'); text(-0.91*x1,1.02*y1, '30^o', 'fontsize', Nf, 'horiz', 'right', 'vert', 'bottom'); text(-0.97*x1,-1.01*y1, '150^o', 'fontsize', Nf, 'horiz', 'right', 'vert', 'top'); text(-1.02*x2,0.97*y2, '60^o', 'fontsize', Nf, 'horiz', 'right', 'vert', 'bottom'); text(-1.01*x2,-1.01*y2, '120^o', 'fontsize', Nf, 'horiz', 'right', 'vert', 'top'); end 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, 'dB', 'fontsize', Nf, 'horiz', 'left', 'vert', 'top'); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  • 60. 60 Practical - 16 AIM : To write a program to plot the radiation pattern for Binomial antenna array. THEORY :
  • 61. 61 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= (k.*d.*cosd(theta)) + beta; AF= (1+exp(1j.*(deg2rad(psi)))).^(N-1); AE= (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;
  • 62. 62 OUTPUT : Elapsed time is 0.572803 seconds. 0.5 1 30 210 60 240 90 270 120 300 150 330 180 0 50 100 30 210 60 240 90 270 120 300 150 330 180 0 50 100 30 210 60 240 90 270 120 300 150 330 180 0 Binomial array CONCLUSIONS :
  • 63. 63 Practical - 17 AIM : To write a program to plot radiation pattern for Broadside antenna array. THEORY :
  • 64. 64 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= input('nEnter the number of Elements::->'); d= input('nEnter the distance between the elements::->'); k= 360; c= (k.*d)./2; %%CALCULATING ARRAY FACTOR AND ARRAY ELEMENT... num= ((1./N).*sind(N.*c.*cosd(theta))); den= sind(c.*cosd(theta)); AF = num./den; AE = (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;
  • 65. 65 OUTPUT : Enter the number of Elements::->5 Enter the distance between the elements::->0.5 Elapsed time is 11.856490 seconds. 0.5 1 30 210 60 240 90 270 120 300 150 330 180 0 0.5 1 30 210 60 240 90 270 120 300 150 330 180 0 0.5 1 30 210 60 240 90 270 120 300 150 330 180 0 Broadside array CONCLUSIONS :
  • 66. 66 Practical - 18 AIM : To write a program to plot radiation pattern for Endfire antenna array. THEORY :
  • 67. 67 MATLAB PROGRAM : % clear; clc; tic; %%Initialisation %AF = zeros(1,360); %AE = zeros(1,360); theta=1:360; %%ACCEPTING INPUTS.. N= input('nEnter the number of Elements::->'); d= input('nEnter the distance between the elements::->'); k= 360; c= (k.*d)./2; %%CALCULATING ARRAY FACTOR AND ARRAY ELEMENT... num= ((1./N).*sind(N.*c.*(cosd(theta)+1))); den= sind(c.*(cosd(theta)+1)); AF= num./den; AE= (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; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  • 68. 68 OUTPUT : Enter the number of Elements::->5 Enter the distance between the elements::->0.5 Elapsed time is 6.356738 seconds. 0.5 1 30 210 60 240 90 270 120 300 150 330 180 0 0.5 1 30 210 60 240 90 270 120 300 150 330 180 0 0.5 1 30 210 60 240 90 270 120 300 150 330 180 0 Endfire array CONCLUSIONS :
  • 69. 69 Practical - 19 AIM : To write a program to plot 3D radiation pattern for Binomial antenna array. THEORY :
  • 70. 70 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)) + beta; AF = (1+exp(1j.*(psi))).^(N-1); AF = 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,abs(AE)); surf(x1,y1,z1,'FaceLighting','phong',... 'LineStyle','none',... 'FaceColor',[1 0 0]);
  • 71. 71 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 : Enter the number of Elements::(eg., 5,6,7,etc)->6 Enter the distance between the elements::(eg.,0.4,0.5,etc)- >0.5 Elapsed time is 0.056854 seconds.
  • 73. 73 Practical - 20 AIM : To write a program to plot 3D radiation pattern for Broadside antenna array. THEORY :
  • 74. 74 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 = ((1./N).*sin(N.*c.*cos(theta))); den = sin(c.*cos(theta)); AF = num./den; AF = 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
  • 75. 75 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]); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%
  • 76. 76 OUTPUT : Enter the number of Elements::(eg., 5,6,7,etc)->6 Enter the distance between the elements::(eg.,0.4,0.5,etc)- >0.5 Elapsed time is 0.173608 seconds. CONCLUSIONS :
  • 77. 77 Practical - 21 AIM : To write a program to plot 3D radiation pattern for Endfire antenna array THEORY :
  • 78. 78 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 = num./den; AF = 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')
  • 79. 79 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 : Enter the number of Elements::(eg., 5,6,7,etc)->6 Enter the distance between the elements::(eg.,0.4,0.5,etc)- >0.5 Elapsed time is 0.136698 seconds.
  • 81. 81 Practical - 22 AIM : To write a program to plot 3-D Radiation Pattern of Dipole Antenna. THEORY :
  • 82. 82 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
  • 83. 83 % converting to spherical coordinates [x,y,z]=sph2cart(phi,theta,U); %plotting routine surf(x,y,z) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% OUTPUT : -40 -20 0 20 40 -40 -20 0 20 40 -30 -20 -10 0 10 20 30 CONCLUSIONS :