www.gusucode.com > phased 案例源码 matlab代码程序 > phased/EstimateDOAsOfTwoSignalsAtDiskArrayExample.m
%% Estimate DOAs of Two Signals at Disk Array % Assume that two sinusoidal waves of frequencies 1.6 kHz and 1.8 kHz % strike a disk array from two different directions. The spacing between % elements of the disk is 1/2 wavelength. Signals arrive from -31° % azimuth, -11° elevation and 35° azimuth, 55° elevation. Use % 2-D MUSIC to estimate the directions of arrival of the two signals. The % array operating frequency is 300 MHz and the signal sampling frequency is % 8 kHz. %% % *Note:* This example runs only in R2016b or later. If you are using an earlier % release, replace each call to the function with the equivalent |step| % syntax. For example, replace |myObject(x)| with |step(myObject,x)|. f1 = 1.6e3; f2 = 1.8e3; doa1 = [-31;-11]; doa2 = [35;55]; fc = 300e6; c = physconst('LightSpeed'); lam = c/fc; fs = 8.0e3; %% % Create a conformal array with default isotropic elements. First, create a URA to get the element positions. uraarray = phased.URA('Size',[21 21],'ElementSpacing',[lam/2 lam/2]); pos = getElementPosition(uraarray); %% % Extract a subset of these to form an inscribed disk. radius = 10.5*lam/2; pos(:,sum(pos.^2) > radius^2) = []; %% % Then, create the conformal array using these positions. confarray = phased.ConformalArray('ElementPosition',pos); viewArray(confarray) %% % Set the frequency response range of the elements. confarray.Element.FrequencyRange = [50.0e6 600.0e6]; %% % Create the two signals and add random noise. t = (0:1/fs:1.5).'; x1 = cos(2*pi*t*f1); x2 = cos(2*pi*t*f2); x = collectPlaneWave(confarray,[x1 x2],[doa1,doa2],fc); noise = 0.1*(randn(size(x)) + 1i*randn(size(x))); %% % Create and execute the 2-D MUSIC estimator to find the directions of % arrival. estimator = phased.MUSICEstimator2D('SensorArray',confarray,... 'OperatingFrequency',fc,... 'NumSignalsSource','Property',... 'DOAOutputPort',true,'NumSignals',2,... 'AzimuthScanAngles',-60:.1:60,... 'ElevationScanAngles',-60:.1:60); [~,doas] = estimator(x + noise) %% % The estimated DOAs exactly match the true DOAs. %% % Plot the 2-D spatial spectrum plotSpectrum(estimator);