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

    %% Create Grating Lobe Diagram for Microphone URA with Frequency Shift
% Plot the grating lobe diagram for an 11-by-9-element uniform
% rectangular array having element spacing greater than one-half
% wavelength. Apply a 20% phase-shifter frequency offset. Grating lobes are
% plotted in u-v coordinates.
%
% Assume the operating frequency of the array is 10 kHz and the
% spacing between elements is 0.75 of a wavelength. All elements
% are omnidirectional microphone elements. Steer the array in
% the direction 20 degrees in azimuth and 30 degrees in elevation.
% The shifted frequency is 12000 Hz.
% The speed of sound in air is 344.21 m/s at 21 deg C.

% Copyright 2015 The MathWorks, Inc.

cair = 344.21;
f = 10000;
f0 = 12000;
lambda = cair/f;
sMic = phased.OmnidirectionalMicrophoneElement(...
    'FrequencyRange',[20 20000]);
sURA = phased.URA('Element',sMic,'Size',[11,9],...
    'ElementSpacing',0.75*lambda*[1,1]);
plotGratingLobeDiagram(sURA,f,[20;30],cair,f0);
%%
% The mainlobe of the array is indicated by a filled black circle.
% The mainlobe has moved from its position in the previous example due to the
% frequency shift. The grating lobes in visible and
% nonvisible regions 
% are indicated by unfilled black circles. The visible region is the
% region in u-v coordinates for which $u^2 + v^2 \le 1$. The visible region is shown
% as a unit circle centered at the origin. Because the array
% spacing is greater than one-half wavelength, there are grating
% lobes in the visible region of space. There are an infinite
% number of grating lobes in the nonvisible regions, but only
% those in the range [-3,3] are shown. 
%%
% The grating-lobe free region, shown in green, is the range of
% directions of the main lobe for which there are no grating
% lobes in the visible region. In this case, it lies inside 
% the visible region. Because the mainlobe is outside the green area, there is a 
% grating lobe within the visible region.