clc;clear;close all;
%% 添加临时环境
addpath('..\0_辅助函数');
addpath('..\2_1_1_杂波模型');
addpath('..\2_1_2_背景环境');
addpath('..\2_3_1_CFAR标称因子');
addpath('..\2_2_2_CFAR_NN');
%% 均匀背景环境
PFA=1e-6;
NSlide=30;
NProt=6;
rate=0.75;%0.75
delta=1/512;
iLoop=1000;
KVI=4.76;
KMR=1.806;
%% 标称因子计算
alpha=zeros(7,2);
alpha(1,1)= form_alpha_CA(PFA,NSlide);
alpha(2,1)= form_alpha_GO(PFA,NSlide);
alpha(3,1)= form_alpha_SO(PFA,NSlide);
alpha(4,1)= form_alpha_OS(PFA,NSlide,rate);
alpha(5,:)= form_alpha_VI(PFA,NSlide);
alpha(6,1)= form_alpha_CM_point(PFA,delta,iLoop);
alpha(7,1)= form_alpha_DOM(PFA);
%% 正式处理
% version1_env_uniform;
version2_env_multiple;
[T_opt] = func_T_opt(PFA,lambda,dB,num);
% version3_env_edge;
% x(1,40)=form_Power_DB2A(dB(1,1)+25);
% x(1,98)=form_Power_DB2A(dB(1,1)+25);% 杂波边缘-低功率区-添加目标
% x(1,104)=form_Power_DB2A(dB(1,2)+16);% 杂波边缘-高功率区-添加杂波
% [T_opt] = func_T_opt(PFA,lambda,dB,[1,range]);
[results_CA] = func_CFAR_CA(x,alpha(1,1),NSlide,NProt);
[results_GO] = func_CFAR_GO(x,alpha(2,1),NSlide,NProt);
[results_SO] = func_CFAR_SO(x,alpha(3,1),NSlide,NProt);
[results_OS] = func_CFAR_OS(x,alpha(4,1),NSlide,NProt,rate);
[results_VI] = func_CFAR_VI(x,alpha(5,:),NSlide,NProt,KVI,KMR);
[results_NN] = func_CFAR_NN(x,alpha(1:4,1),NSlide,NProt,rate);
%% 绘制图谱
len=length(x);
plotNum=18;
markersize=5;
LineWidth=1.25;
figure(1);
plot(form_Power_A2DB(T_opt),'Color',[0 1 0],'LineWidth',LineWidth),hold on;
% plot(form_Power_A2DB(results_CA{1,2}),'-.','Color',[1 0 0],'LineWidth',LineWidth),hold on;
% plot(form_Power_A2DB(results_GO{1,2}),'Color',[0.8500 0.3250 0.0980],'Marker','v','MarkerIndices',2:plotNum:len,'markersize',markersize,'LineWidth',LineWidth),hold on;
% plot(form_Power_A2DB(results_SO{1,2}),'Color',[0.9290 0.6940 0.1250],'Marker','^','MarkerIndices',4:plotNum:len,'markersize',markersize,'LineWidth',LineWidth),hold on;
% plot(form_Power_A2DB(results_OS{1,2}),'Color',[0.4940 0.1840 0.5560],'Marker','o','MarkerIndices',6:plotNum:len,'markersize',markersize,'LineWidth',LineWidth),hold on;
plot(form_Power_A2DB(results_VI{1,2}),'Color',[0.3010 0.7450 0.9330],'Marker','x','MarkerIndices',8:plotNum:len,'markersize',markersize,'LineWidth',LineWidth),hold on;
plot(form_Power_A2DB(results_NN{1,2}),'Color', [0 0 1],'Marker','*','MarkerIndices',10:plotNum:len,'markersize',markersize,'LineWidth',LineWidth),hold on;
% plot(form_Power_A2DB(results_CM{1,2}),'Color',[0 0 1],'Marker','p','MarkerIndices',12:plotNum:len,'markersize',markersize,'LineWidth',LineWidth),hold on;
% plot(form_Power_A2DB(results_DOM{1,2}),'Color',[1 1 0],'Marker','h','MarkerIndices',14:plotNum:len,'markersize',markersize,'LineWidth',LineWidth),hold on;
trgtFlag = exist('trgt','var') ;
if trgtFlag%有无目标点
plot(trgt(:,1),form_Power_A2DB(trgt(:,2)),'s','Color',[1 0 1],'MarkerSize',4),hold on;
end
% 杂波边缘-低功率区-添加目标
% plot(98,form_Power_A2DB(x(1,98)),'s','Color',[1 0 1],'MarkerSize',5,'LineWidth',2),hold on;
plot(form_Power_A2DB(x),'Color','[0 0.4470 0.7410]','LineWidth',LineWidth),hold on;
grid minor;
xlabel('\fontname{宋体}\fontsize{7}距离单元\fontname{Euclid}\fontsize{7}');
ylabel('\fontname{宋体}\fontsize{7}幅度(dB)\fontname{Euclid}\fontsize{7}');
if trgtFlag%有无目标点
% h=legend('opt','CA','GO','SO','目标','Location','SouthEast','NumColumns',1);
% h=legend('opt','OS','目标','Location','SouthEast','NumColumns',1);
h=legend('opt','VI','NN','目标','Location','SouthEast','NumColumns',1);
% h=legend('CA','GO','SO','VI','Location','SouthEast','NumColumns',1);
% h=legend('CA','GO','SO','OS','NN','Location','SouthEast','NumColumns',1);
% h=legend('VI','NN','目标','Location','SouthEast','NumColumns',1);
% h=legend('opt','CA','GO','SO','OS','VI','NN','Location','SouthEast','NumColumns',1);
% h=legend('OS','Location','SouthEast','NumColumns',1);
else
% h=legend('opt','CA','GO','SO','Location','SouthEast','NumColumns',1);
% h=legend('opt','OS','Location','SouthEast','NumColumns',1);
h=legend('opt','VI','NN','Location','SouthEast','NumColumns',1);
% h=legend('VI','NN','Location','SouthEast','NumColumns',1);
% h=legend('OS','目标','Location','SouthEast','NumColumns',1);
% h=legend('opt','CA','GO','SO','OS','VI','NN','Location','SouthEast','NumColumns',1);
end
set(h,'edgecolor','none')
- 1
- 2
- 3
- 4
前往页