Antenna Radiation - 16x1 Array : Beam Steering

This code is a MATLAB script designed for visualizing the steering of an antenna beam. The main purpose is to demonstrate how the beam pattern of a 16x1 antenna array changes when a specific parameter (the phase or steering angle) is varied.

This code simulates the beam steering capability of a phased array antenna by adjusting the phase of signals emitted from each antenna element, visualizing how these adjustments influence the direction and shape of the emitted beam. The visualization provides an intuitive understanding of beam steering principles in antenna arrays, crucial for applications like radar, wireless communications, and electronic warfare.

Here's a high-level description of its functionality:

  • Parameter Setup: The code initializes a grid of points in the x-y plane, with both x and y ranging from −10π to 10π in steps of π/10. This grid serves as the space where the antenna beam pattern will be visualized.
  • Antenna Array Configuration: It defines a half-wavelength spaced linear antenna array with n=8 elements. The variable k seems to represent the wavenumber or a related parameter that affects the phase progression across thearray elements. The variable p is used in the beamforming function, possibly representing the phase shift or a related parameter that influences the beam direction.
  • Beam Steering Calculation: For each element in the antenna array, it calculates a phase-shifted version of the x-y grid to simulate the effect of the antenna element's position and phase on the overall beam pattern. It uses the waveCosPh function to compute the contribution of each antenna element at every point in the space, summing up these contributions to form the composite beam patternrepresented by Z.
  • Visualization: The script then plots the resulting beam pattern in two subplots within a single figure window. The first subplot presents a 3D surface plot of the beam pattern from a diagonal view ([-40 70] degrees), and the second subplot shows the same beam pattern from a top-down view ([0 90] degrees). Both plots use a color scale to represent the amplitude of the beam pattern and have theiraxes labels and ticks removed for clarity.
  • waveCosPh Function: This helper function calculates the cosine of the phase-shifted distance from the origin for each point in the grid, with an adjustment made for points beyond a certain radius r. This function is critical for generating the beam pattern, as it encapsulates the wave's behavior in response to the antenna array's geometry and phase shifts.

 

 

Followings are the code that I wrote in Octave to creates all the plots shown in this page. You may copy these code and play with these codes. Change variables and try yourself until you get your own intuitive understanding.

 

< Code 1 >

 

function main

  

xstep = -10*pi:pi/10:10*pi;

ystep = -10*pi:pi/10:10*pi;;

[X,Y] = meshgrid(xstep,ystep);

 

n=8; % should be even integer

k=2;

p = 36*pi/4;

 

Z = zeros(length(xstep));

for i = ((0:(n-1))-((n-1)/2))

   [X1,Y1] = meshgrid(xstep+(i*pi/k),ystep);

   Z = Z+(waveCosPh(X1,Y1,p,p));

end;

 

hFig = figure(1,'Position',[300 300 700 280]);

subplot(1,2,1);

surface(X,Y,Z,'edgecolor','none');

xlim([-10*pi 10*pi]);ylim([-10*pi 10*pi]);zlim([-10,10]);

view([-40 70]);

set(gca,'xticklabel',[]);

set(gca,'yticklabel',[]);

set(gca,'zticklabel',[]);

set(gca,'xtick',[]);

set(gca,'ytick',[]);

set(gca,'ztick',[]);

 

subplot(1,2,2);

surface(X,Y,Z,'edgecolor','none');

xlim([-10*pi 10*pi]);ylim([-10*pi 10*pi]);zlim([-10,10]);

view([0 90]);

set(gca,'xticklabel',[]);

set(gca,'yticklabel',[]);

set(gca,'zticklabel',[]);

set(gca,'xtick',[]);

set(gca,'ytick',[]);

set(gca,'ztick',[]);

 

end;

 

function z = waveCosPh(x,y,Ph,r)

 

 d = sqrt(x.^2 + y.^2)-Ph;

 dim = size(d);

 dr = dim(1);

 dc = dim(2);

 

 for i = 1 : dr

     for j = 1 : dc

         if d(i,j) > r

            d(i,j) = pi/2;

         end;    

     end;     

 end;    

 

 %z = cos(d-Ph);

 z = cos(d);

 

end