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

    %% Display MUSIC Spectrum Over Specified Direction Span
% Calculate the directions of arrival of 4 uncorrelated signals arriving at
% an 11-element ULA. The element spacing is 0.5 wavelengths. Assume the
% signals are coming from the broadside angles of –60.2°,
% –20.7°, 0.5°, and 84.8°. The noise at each element is
% Gaussian white noise and is uncorrelated between elements. The SNR is 0
% dB.

%%
% Specify the number of ULA elements and the element spacing (in
% wavelengths).
nelem = 11;
d = 0.5;
snr = 5.0;
elementPos = (0:nelem-1)*d;
%%
% Specify the number of signals and their broadside arrival angles.
nsig = 4;
angles = [-60.2 -20.7 0.5 84.8];
%%
% Create the sensor covariance matrix.
covmat = sensorcov(elementPos,angles,db2pow(-snr));
%%
% Compute the MUSIC spectrum and estimate the broadside arrival angles in
% the range from -70° to 90° in 0.1° increments.
[doas,spec,specang] = musicdoa(covmat,nsig,'ScanAngles',[-70:.1:90]);
%%
% Plot the MUSIC spectrum.
plot(specang,10*log10(spec))
xlabel('Arrival Angle (deg)')
ylabel('Magnitude (dB)')
title('MUSIC Spectrum')
grid
%%
%
disp(doas)
%%
% The estimated angles match the specified angles.