%%%%%%%36个参考单元%%%%%%%%%
clear
clc
close all
Pfa=1e-6;
b=2.5;%尺度参数
c=1.8;%形状参数
M1=32;%矩形窗相参积累脉冲个数
N1=9;%矩形窗距离单元数
M2=32;%十字窗相参积累脉冲个数
N2=23;%十字窗距离单元数
Nf1=5;%矩形窗参考滑窗多普勒单元数
Nr1=9;%矩形窗参考滑窗距离单元数
Nf2=21;%十字窗参考滑窗多普勒单元数
Nr2=23;%十字窗参考滑窗距离单元数
factor1=13;
factor2=15;
s1=zeros(M1,N1);
s2=zeros(M2,N2);
k=0;
R1=Nf1*Nr1-3*3;%矩形窗参考单元数
R2=(Nf2+Nr2-1)-(2*2+1*2+1);%参考单元数
T1=R1*(Pfa^(-1/R1)-1);
T2=R2*(Pfa^(-1/R2)-1);
clutterpower=b^(-2/c)*gamma(2/c+1);%杂波功率
for scr=-20:0
k=k+1;
pd1(k)=0;
pd2(k)=0;
A=sqrt(2*clutterpower*10^(scr/10));%计算目标信号的幅度
nn1=0:M1-1;
nn2=0:M2-1;
sd1=exp(-j*2*pi*(factor1-1)*nn1/M1);
sd2=exp(-j*2*pi*(factor2-1)*nn2/M2);
s1(:,(N1+1)/2)=A.*sd1';
s2(:,(N2+1)/2)=A.*sd2';
for testnumber=1:10000
r1=weibrnd(b,c,M1,N1);%仿真的杂波
r2=weibrnd(b,c,M2,N2);%仿真的杂波
z1=r1+s1;%总的接收信号
z2=r2+s2;%总的接收信号
y1=abs(fft(z1));
y2=abs(fft(z2));
y1=y1.^2;
y2=y2.^2;
y1=y1(factor1-2:factor1+2,:);%矩形窗口大小5X9,待检测单元为y1(3,5)
y2=y2(factor2-10:factor2+10,:);%参考窗为21+23的十字窗
yd1=y1(3,(N1+1)/2);
yd2=y2(11,(N2+1)/2);
clutterlevel_gj1=(sum(sum(y1))-sum(sum(y1(2:4,4:6))))/R1;%杂波电平估计
clutterlevel_gj2=(sum(y2(11,:))+sum(y2(:,(N2+1)/2))-sum(y2(11,10:14))-sum(y2(10:12,(N2+1)/2)))/R2;
threshold1=T1*clutterlevel_gj1;%真实的门限
threshold2=T2*clutterlevel_gj2;%真实的门限
if yd1>threshold1
pd1(k)=pd1(k)+1;
end
if yd2>threshold2
pd2(k)=pd2(k)+1;
end
end
pd1(k)=pd1(k)/10000;
pd2(k)=pd2(k)/10000;
end
scr=-20:0;
plot(scr,pd1,'<-');
grid on;hold on;
plot(scr,pd2,'*-');
%%%%%%%28个参考单元%%%%%%%%
M1=32;%矩形窗相参积累脉冲个数
N1=9;%矩形窗距离单元数
M2=32;%十字窗相参积累脉冲个数
N2=19;%十字窗距离单元数
Nf1=5;%矩形窗参考滑窗多普勒单元数
Nr1=9;%矩形窗参考滑窗距离单元数
Nf2=17;%十字窗参考滑窗多普勒单元数
Nr2=19;%十字窗参考滑窗距离单元数
factor1=13;
factor2=15;
s1=zeros(M1,N1);
s2=zeros(M2,N2);
k=0;
R1=Nf1*Nr1-17;%矩形窗参考单元数
R2=(Nf2+Nr2-1)-(2*2+1*2+1);%参考单元数
T1=R1*(Pfa^(-1/R1)-1);
T2=R2*(Pfa^(-1/R2)-1);
clutterpower=b^(-2/c)*gamma(2/c+1);%杂波功率
for scr=-20:0
k=k+1;
pd1(k)=0;
pd2(k)=0;
A=sqrt(2*clutterpower*10^(scr/10));%计算目标信号的幅度
nn1=0:M1-1;
nn2=0:M2-1;
sd1=exp(-j*2*pi*(factor1-1)*nn1/M1);
sd2=exp(-j*2*pi*(factor2-1)*nn2/M2);
s1(:,(N1+1)/2)=A.*sd1';
s2(:,(N2+1)/2)=A.*sd2';
for testnumber=1:10000
r1=weibrnd(b,c,M1,N1);%仿真的杂波
r2=weibrnd(b,c,M2,N2);%仿真的杂波
z1=r1+s1;%总的接收信号
z2=r2+s2;%总的接收信号
y1=abs(fft(z1));
y2=abs(fft(z2));
y1=y1.^2;
y2=y2.^2;
y1=y1(factor1-2:factor1+2,:);%矩形窗口大小5X9,待检测单元为y1(3,5)
y2=y2(factor2-8:factor2+8,:);%参考窗为17+19的十字窗
yd1=y1(3,(N1+1)/2);
yd2=y2(9,(N2+1)/2);
clutterlevel_gj1=(sum(sum(y1))-sum(sum(y1(2:4,3:7)))-y1(1,5)-y1(5,5))/R1;%杂波电平估计
clutterlevel_gj2=(sum(y2(9,:))+sum(y2(:,(N2+1)/2))-sum(y2(9,8:12))-sum(y2(8:10,(N2+1)/2)))/R2;
threshold1=T1*clutterlevel_gj1;%真实的门限
threshold2=T2*clutterlevel_gj2;%真实的门限
if yd1>threshold1
pd1(k)=pd1(k)+1;
end
if yd2>threshold2
pd2(k)=pd2(k)+1;
end
end
pd1(k)=pd1(k)/10000;
pd2(k)=pd2(k)/10000;
end
scr=-20:0;
plot(scr,pd1,'o-');
grid on;hold on;
plot(scr,pd2,'p-');
%%%%%%%%%20个参考单元%%%%%%%%%%
M1=32;%矩形窗相参积累脉冲个数
N1=7;%矩形窗距离单元数
M2=32;%十字窗相参积累脉冲个数
N2=15;%十字窗距离单元数
Nf1=5;%矩形窗参考滑窗多普勒单元数
Nr1=7;%矩形窗参考滑窗距离单元数
Nf2=13;%十字窗参考滑窗多普勒单元数
Nr2=15;%十字窗参考滑窗距离单元数
factor1=13;
factor2=15;
s1=zeros(M1,N1);
s2=zeros(M2,N2);
k=0;
R1=Nf1*Nr1-3*5;%矩形窗参考单元数
R2=(Nf2+Nr2-1)-(2*2+1*2+1);%参考单元数
T1=R1*(Pfa^(-1/R1)-1);
T2=R2*(Pfa^(-1/R2)-1);
clutterpower=b^(-2/c)*gamma(2/c+1);%杂波功率
for scr=-20:0
k=k+1;
pd1(k)=0;
pd2(k)=0;
A=sqrt(2*clutterpower*10^(scr/10));%计算目标信号的幅度
nn1=0:M1-1;
nn2=0:M2-1;
sd1=exp(-j*2*pi*(factor1-1)*nn1/M1);
sd2=exp(-j*2*pi*(factor2-1)*nn2/M2);
s1(:,(N1+1)/2)=A.*sd1';
s2(:,(N2+1)/2)=A.*sd2';
for testnumber=1:10000
r1=weibrnd(b,c,M1,N1);%仿真的杂波
r2=weibrnd(b,c,M2,N2);%仿真的杂波
z1=r1+s1;%总的接收信号
z2=r2+s2;%总的接收信号
y1=abs(fft(z1));
y2=abs(fft(z2));
y1=y1.^2;
y2=y2.^2;
y1=y1(factor1-2:factor1+2,:);%矩形窗口大小5X7,待检测单元为y1(3,4)
y2=y2(factor2-6:factor2+6,:);%参考窗为13+15的十字窗
yd1=y1(3,(N1+1)/2);
yd2=y2(7,(N2+1)/2);
clutterlevel_gj1=(sum(sum(y1))-sum(sum(y1(2:4,3:7))))/R1;%杂波电平估计
clutterlevel_gj2=(sum(y2(7,:))+sum(y2(:,(N2+1)/2))-sum(y2(7,6:10))-sum(y2(6:8,(N2+1)/2)))/R2;
threshold1=T1*clutterlevel_gj1;%真实的门限
threshold2=T2*clutterlevel_gj2;%真实的门限
if yd1>threshold1
pd1(k)=pd1(k)+1;
end
if yd2>threshold2
pd2(k)=pd2(k)+1;
end
end
pd1(k)=pd1(k)/10000;
pd2(k)=pd2(k)/10000;
end
scr=-20:0;
plot(scr,pd1,'h-');
grid on;hold on;
plot(scr,pd2,'d-');
xlabel('scr/dB');
ylabel('pd');
legend('矩形窗:36参考单元','十字窗:36参考单元','矩形窗:28参考单元','十字窗:28参考单元','矩形窗:20参考单元','十字窗:20参考单元');
评论1