⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 musicdoa.m

📁 基于MATLAB的MUSIC算法的示例
💻 M
字号:
%方向图
clc
clear
M=15;
x=0.3;%波长
d=0.5*x;

thta0=21*pi/180;
thta1=0*pi/180;
thta2=-40*pi/180;
thta3=3*pi/180;


% J1=zeros(M,M);
% for i=1:M
%     J1(i,M-i+1)=1;
% end

t=0:1e-10:4e-8;


s0=1*exp(j*2*pi*(1.0e6*t));%
s1=10*exp(j*2*pi*2e6*t);
s2=1*exp(j*2*pi*3e6*t);

for p=1:M
athita0(p,1)=exp(j*2*pi*(p-1)*d/x*sin(thta0));
athita1(p,1)=exp(j*2*pi*(p-1)*d/x*sin(thta1));
athita2(p,1)=exp(j*2*pi*(p-1)*d/x*sin(thta2));
athita3(p,1)=exp(j*2*pi*(p-1)*d/x*sin(thta3));
end

for cl=1:10%一百 次 实验 
nt=0.1*(1+j)/sqrt(2)*randn(M,401);
A=[athita0 athita1 athita2];
S=[s0' s1' s2'];
X=A*S'+nt;
R=1/401*(A*S'*(S)*(A')+nt*(nt')); 

% R=R-J1*R*J1;
[V,D]=eig(R);

    ii=1:M;
    dd1=abs(sum(D));
    dd=dd1;
    [g,h]=max((dd));
    h1=h;
    dd(h1)=0;
    [g,h]=max((dd));
    h2=h;
    dd(h2)=0;
    [g,h]=max((dd));
    h3=h;

VV=[V(:,h1)/norm(V(:,h1)) V(:,h2)/norm(V(:,h2)) V(:,h3)/norm(V(:,h3))];

I=eye(M);
k=1;
for thta=-60*pi/180:0.1*pi/180:60*pi/180
    for p=1:M
        thita0(p,k)=exp(j*2*pi*(p-1)*d/x*sin(thta));
    end
    A1=[thita0(:,k)];

    doa(k)=1/(A1'*(I-VV*VV')*(A1));
    k=k+1;
end
 ff(cl,:)=doa;
end

yyy1=sum(ff);

 y5=20*log10(abs(yyy1)/max(abs(yyy1)));
 l=-60:0.1:60;
 figure
plot(l,y5) 


l=0





⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -