?? music_spectrum.m
字號:
function P = music(Y,M,d,Lamda,angle,K)
%MUSIC Multiple Signal Classification Method for direction finding.
%
% Usage: P = music(Y,M,d,Lamda,angle,K)
%
%Input parameters:
%
% Y - M x N matrix, the array output data
% M - the number of linear array
% N - the snapshots used in estimation
% d - the space of each two sensors ( Same as Lambda )
% Lamda - the wavelength of source signal ( Same as D )
% angle - the searching range in degree, For example,
% [-20:0.1:20] means search the angle from -20 deg. to
% 20 deg. with step 0.1
% K - the number of sources
%
%Output parameter:
%
% P - the spatial unified spectrum according to Angles.
%
%
error(nargchk(nargin,6,6));
R=Y*Y'; %covariance matrix
[V S]=eig(R);
[A I]=sort(diag(S));
for i=1:M
VV(:,i)=V(:,I(i,1));
end
En=VV(:,1:M-K); % En is called noise subspace
i=0;
P=zeros(size(angle));
for ang=angle
a=exp(j*2*pi*d/Lamda*sin(ang*pi/180)*[0:M-1]');
i=i+1;
P(i)=1/abs(a'*En*En'*a);
end
P=10*log10(P/max(P));
return
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -