📄 problem4.m
字号:
%MUSIC Algorithm
%ELEC 6022 Sonar Coursework
%---Nan LIN
%last modified on 3 May
clear;
K=8; %the number of signal sources
P=5; %large directional signals present
N=20; %the number of sensors on a line array
c=1500; %speed of light
f=1000; %frequency
theta=pi/2; %assume that theta=90 degree.K sources are on the x-y plane
phi=10:20:150; %assume K angles of sources
phi=phi*pi/180;
amp=5*ones(1,8); %assume amplitudes of K sources
S(1:N,1:K)=0;
for bb=1:K;
for aa=1:N;
S(aa,bb)=exp(j*2*pi*f*propdelay(theta,phi(bb),aa));
end;
S(1:N,bb)=amp(bb)*S(1:N,bb);
end;
Rn=0.02; %noise power
R=S*S'+eye(N,N).*Rn;
[V D]=eig(R); % examine D matrix. pick out K largest eigenvalues
nn=1000; %bearing resolution
S1(1:N,1:nn)=0;
ei=V(1:N,1:N-P); % ei correspond to N-K left eigenvalues
phix=0:180/(nn-1):180; %assume look direction is from 0 to 180.
phix=phix*pi/180;
for bb=1:nn;
for aa=1:N;
S1(aa,bb)=exp(j*2*pi*f*propdelay(theta,phix(bb),aa));
end;
end;
F=1./sum(abs(ei'*S1));
phix=phix*180/pi;
plot(phix,F);
title('The MUSIC spectrum K=8 P=5');
xlabel('Phi(degree)');
ylabel('F(directional spectrum)');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -