www.gusucode.com > phased 案例源码 matlab代码程序 > phased/DirectivityURAExample.m

    %% Directivity of Uniform Rectangular Array
% Compute the directivity of two uniform rectangular arrays (URA). The
% first array consists of isotropic antenna elements. The second array
% consists of cosine antenna elements. In addition, compute the directivity
% of the first array steered to a specific direction.

% Copyright 2015 The MathWorks, Inc.


%% Array of isotropic antenna elements 
% First, create a 10-by-10-element URA of isotropic antenna elements spaced
% one-quarter wavelength apart. Set the signal frequency to 800 MHz.
c = physconst('LightSpeed');
fc = 3e8;
lambda = c/fc;
myAntIso = phased.IsotropicAntennaElement;
myArray1 = phased.URA;
myArray1.Element = myAntIso;
myArray1.Size = [10,10];
myArray1.ElementSpacing = [lambda*0.25,lambda*0.25];
ang = [0;0];
d = directivity(myArray1,fc,ang,'PropagationSpeed',c)
%% Array of cosine antenna elements
% Next, create a 10-by-10-element URA of cosine antenna elements also
% spaced one-quarter wavelength apart.
myAntCos = phased.CosineAntennaElement('CosinePower',[1.8,1.8]);
myArray2 = phased.URA;
myArray2.Element = myAntCos;
myArray2.Size = [10,10];
myArray2.ElementSpacing = [lambda*0.25,lambda*0.25];
ang = [0;0];
d = directivity(myArray2,fc,ang,'PropagationSpeed',c)
%%
% The directivity is increased due to the directivity of the cosine antenna
% elements.
%% Steered array of isotropic antenna elements
% Finally, steer the isotropic antenna array to 30 degrees in azimuth and
% examine the directivity at the steered angle.
ang = [30;0];
w = steervec(getElementPosition(myArray1)/lambda,ang);
d = directivity(myArray1,fc,ang,'PropagationSpeed',c,...
    'Weights',w)
%%
% The directivity is maximum in the steered direction and equals the
% directivity of the unsteered array at boresight.