找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 3833|回復(fù): 1
收起左側(cè)

恒虛警處理算法MATLAB源碼

[復(fù)制鏈接]
ID:316363 發(fā)表于 2018-4-25 16:45 | 顯示全部樓層 |閱讀模式
雷達恒虛警檢測算法處理程序,可以直接使用

單片機源程序如下:
  1. function OCor=CFAR(data)
  2. %edit by yaochen 2016/12/19 SOCA CFAR detection
  3. %解決CA CFAR方法中目標(biāo)遮蔽效應(yīng)問題,SOCA CFAR對于雜波邊緣處理不好
  4. %-------------------------------------
  5. %1-D CFAR detection,
  6. %input data format:1*N
  7. NGC=400;%Num Guard Cells
  8. NTC=800;%Num Training Cells
  9. exp_pfa = 1e-8;%expection of Pfa
  10. nPoint = length(data);
  11. n=0;
  12. OCor=[];
  13. x = abs(data).^2;%signal after a square law detector

  14. Odata=zeros(nPoint,1);

  15. T=zeros(1,nPoint);

  16. for iPoint=1:nPoint
  17.     CI=iPoint;%cell under test
  18.     CIF=CI-NGC/2-1;%cell index forward
  19.     CIB=CI+NGC/2+1;%cell index backward
  20.     if CIF>=1
  21.         if CIF-NTC/2+1>=1
  22.             FIdx=[(CIF-NTC/2+1):CIF];
  23.         else
  24.             FIdx=[1:CIF];
  25.         end
  26.     else
  27.         FIdx=[];
  28.     end
  29.    
  30.     if CIB<=nPoint
  31.         if CIB+NTC/2-1<=nPoint
  32.             BIdx=[CIB:(CIB+NTC/2-1)];
  33.         else
  34.             BIdx=[CIB:nPoint];
  35.         end
  36.     else
  37.         BIdx=[];
  38.     end
  39.    
  40.     N1=size(BIdx,2);
  41.     N2=size(FIdx,2);
  42.     if N1>0 && N2>0
  43.         np_e1=sum(x(BIdx))/N1;
  44.         alpha1=N1*(exp_pfa^(-1/N1)-1);
  45.         T1=alpha1*np_e1;
  46.    
  47.         np_e2=sum(x(FIdx))/N2;
  48.         alpha2=N2*(exp_pfa^(-1/N2)-1);
  49.         T2=alpha2*np_e2;
  50.         T(iPoint)=min(T1,T2);
  51.     else
  52.         N=(size(BIdx,2)+size(FIdx,2));
  53.         np_e=(sum(x(BIdx))+sum(x(FIdx)))/N;
  54.         alpha=N*(exp_pfa^(-1/N)-1);
  55.         T(iPoint)=alpha*np_e;
  56.     end
  57.     if(x(iPoint)>T(iPoint))%here must be >;consider >=,when there is no noise, x =T
  58.         n=n+1;
  59.         OCor(1,n)=1;
  60.         OCor(2,n)=iPoint;
  61.         Odata(iPoint)=1;
  62.     else
  63.         Odata(iPoint)=0;
  64.     end
  65.    
  66. end

  67. % figure(2)
  68. % plot(abs(Odata*max(tempData)),'r')
  69. % hold on;
  70. % plot(abs(tempData));
  71. %
  72. % hold off;
  73. % pause(0.1);

  74. % if isempty(oCor)
  75. %     OCor=[];
  76. % end
  77. end

復(fù)制代碼

所有資料51hei提供下載:
CFAR.zip (986 Bytes, 下載次數(shù): 7)


回復(fù)

使用道具 舉報

ID:317318 發(fā)表于 2018-4-26 20:15 | 顯示全部樓層
您好,請問您有恒虛警性質(zhì)的雷達檢測目標(biāo)的Matlab程序嗎
回復(fù)

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規(guī)則

手機版|小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機教程網(wǎng)

快速回復(fù) 返回頂部 返回列表