%该程序用于计算均匀直线阵(ULA)中信号源个数估计性能随SNR的变化情况,采用Monte-Carlo模拟。
%新添加三个函数:AIC & MDL & HQ ,更改主程序对该函数的应用,和书上曲线有点差异
%2017.4
%==========================================================================
clear
clc
close all
%==========================================================================
M=8; %单元个数
lambda=1; %波长
beta=2*pi/lambda;
d=lambda/2;
%===============================产生信号===================================
L=100; %快拍数
thetas=[0,10,20]*pi/180; %信号来波方向
Ns=length(thetas);%信号源个数
for n=1:Ns
SS(n,1:L)=randn(1,L)+j*randn(1,L);
SS(n,1:L)=SS(n,1:L)/sqrt(SS(n,1:L)*SS(n,1:L)'/L);
%ReSS(n,1:L)=randn(1,L);
%ImSS(n,1:L)=randn(1,L);
%ReSS(n,1:L)=(ReSS(n,1:L)-mean(ReSS(n,1:L)))./std(ReSS(n,1:L));
%ImSS(n,1:L)=(ImSS(n,1:L)-mean(ImSS(n,1:L)))./std(ImSS(n,1:L));
%SS(n,1:L)=(ReSS(n,1:L)+j*ImSS(n,1:L))./...
% sqrt(ReSS(n,1:L).^2+ImSS(n,1:L).^2);
A(1:M,n)=exp(-j*[0:M-1].'*beta*d*sin(thetas(n)));
end
%================================Monte-Carlo===============================
SNR=-20:1:20;
monte=200; %Monte-Carlo模拟的次数
for nsnr=1:length(SNR);
SNR(nsnr)
Ns_AIC=0;
Ns_MDL=0;
Ns_HQ=0;
for mk=1:monte
Renoise=randn(M,L);
Imnoise=randn(M,L);
%=========产生零均值,方差为1的高斯白噪声==========
for n=1:M
Renoise(n,:)=(Renoise(n,:)-mean(Renoise(n,:)))./std(Renoise(n,:));
Imnoise(n,:)=(Imnoise(n,:)-mean(Imnoise(n,:)))./std(Imnoise(n,:));
noise(n,:)=(Renoise(n,:)+j*Imnoise(n,:))./...
sqrt(Renoise(n,:).^2+Imnoise(n,:).^2);
end
%================================================
Ps=10.^(SNR(nsnr)./10); %信噪比
S=Ps.*SS; %信号功率
Y=A*S+noise; %接收到的信号
R=Y*Y'/L; %计算协方差矩阵
D=sort(eig(R),'descend');
[AIC,I1]=min(func_AIC(M,L,D)); %估计到的信号源个数
[MDL,I2]=min(func_MDL(M,L,D));
[HQ,I3]=min(func_HQ(M,L,D));
Ns_AIC(mk)=I1;
Ns_MDL(mk)=I2;
Ns_HQ(mk)=I3;
end
Prob_AIC(nsnr)=length(find(Ns_AIC==Ns))/monte;
Prob_MDL(nsnr)=length(find(Ns_MDL==Ns))/monte;
Prob_HQ(nsnr)=length(find(Ns_HQ==Ns))/monte;
end
plot(SNR,Prob_AIC,'*-')
hold on
plot(SNR,Prob_MDL,'s-')
hold on
plot(SNR,Prob_HQ,'o-')
hold on
xlabel('SNR(dB)')
ylabel('Probability of Detection')
legend('Prob_AIC','Prob_MDL','Prob_HQ','Location','northwest')
评论15