www.gusucode.com > phased 案例源码 matlab代码程序 > phased/TwoSignalsDOAEstimationExample.m
%% Signals With Different Power Levels % Simulate receiving two uncorrelated incoming signals that have different % power levels. A vector named |scov| stores the power levels. % Copyright 2015 The MathWorks, Inc. %% % Create an 8-element uniform linear array whose elements are spaced half % a wavelength apart. fc = 3e8; c = 3e8; lambda = c/fc; ha = phased.ULA(8,lambda/2); %% % Simulate 100 snapshots of the received signal at the array. Assume that % one incoming signal originates from 30 degrees azimuth and has a power % of 3 W. A second incoming signal originates from 60 degrees azimuth and % has a power of 1 W. The two signals are not correlated with each other. % The noise is white across all array elements, and the SNR is 10 dB. ang = [30 60]; scov = [3 1]; x = sensorsig(getElementPosition(ha)/lambda,... 100,ang,db2pow(-10),scov); %% % Use a beamscan spatial spectrum estimator to estimate the arrival directions, % based on the simulated data. hdoa = phased.BeamscanEstimator('SensorArray',ha,... 'PropagationSpeed',c,'OperatingFrequency',fc,... 'DOAOutputPort',true,'NumSignals',2); [~,ang_est] = step(hdoa,x); %% % Plot the spatial spectrum resulting from the estimation process. plotSpectrum(hdoa); %% % The plot shows a high peak at 30 degrees and a lower peak at 60 degrees.