# MUSIC算法原理分析与实现

% DOA estimation by MUSIC
% Developed by Megustas (DLUT）
% Blog ：http://blog.csdn.net/megustas_jjc
clear all
close all
twpi = 2*pi;
kelm = 8;               % number
dd = 0.5;               % space
d=0:dd:(kelm-1)*dd;     %
iwave = 3;              % number of DOA
theta = [10 30 60];     % angle
snr = 10;               % input SNR (dB)
n = 500;                 %
S=randn(iwave,n);
X=A*S;
X1=awgn(X,snr,'measured');
Rxx=X1*X1'/n;
InvS=inv(Rxx); %%%%
[EV,D]=eig(Rxx);%%%%
EVA=diag(D)';
[EVA,I]=sort(EVA);
EVA=fliplr(EVA);
EV=fliplr(EV(:,I));

% MUSIC
for iang = 1:361
angle(iang)=(iang-181)/2;
a=exp(-j*twpi*d*sin(phim)).';
L=iwave;
En=EV(:,L+1:kelm);
SP(iang)=(a'*a)/(a'*En*En'*a);
end

%
SP=abs(SP);
SPmax=max(SP);
SP=10*log10(SP/SPmax);
h=plot(angle,SP);
set(h,'Linewidth',2)
xlabel('angle (degree)')
ylabel('magnitude (dB)')
axis([-90 90 -60 0])
set(gca, 'XTick',[-90:30:90])
grid on



01-12

03-28
06-13
01-05 1万+
09-11 3万+
04-08 2万+
03-12 7522
01-01
05-11
04-27
10-08 253
01-21 2万+
03-23 2万+
01-17 6625