ca3.m
上传用户:tzydjx
上传日期:2022-08-11
资源大小:3k
文件大小:4k
源码类别:

matlab例程

开发平台:

Matlab

  1. %%%%%%%%%%相干韦布尔杂波分布%%%%%%%%%%
  2. azi_num=1000;
  3. fr=1000; %雷达发射信号重频
  4. lamda0=0.05;
  5. sigmav=1.0;
  6. sigmaf=2*sigmav/lamda0;
  7. rand('state',sum(100*clock));
  8. d1=rand(1,azi_num);
  9. rand('state',7*sum(100*clock)+3);
  10. d2=rand(1,azi_num);
  11. xi=1*(sqrt(-2*log(d1)).*cos(2*pi*d2));
  12. coe_num=12;
  13. for n=0:coe_num
  14.     coeff(n+1)=2*sigmaf*sqrt(pi)*exp(-4*sigmaf^2*pi^2*n^2/fr^2)/fr;
  15. end
  16. for n=1:2*coe_num+1
  17.     if n<=coe_num+1
  18.        b(n)=1/2*coeff(coe_num+2-n);
  19.     else
  20.         b(n)=1/2*coeff(n-coe_num);
  21.     end
  22. end
  23. xxi=conv(b,xi);
  24. xsigmac=std(xxi);
  25. xmuc=mean(xxi);
  26. yyi=(xxi-xmuc)/xsigmac;
  27. xq=2*(sqrt(-2*log(d1)).*cos(2*pi*d2));
  28. xxq=conv(b,xq);
  29. xxi=xxi(coe_num*2+1:azi_num+coe_num*2);
  30. xxq=xxq(coe_num*2+1:azi_num+coe_num*2);
  31. xisigmac=std(xxi);
  32. ximuc=mean(xxi);
  33. yyi1=(xxi-ximuc)/xisigmac;
  34. xqsigmac=std(xxq);
  35. xqmuc=mean(xxq);
  36. yyq=(xxq-xqmuc)/xqsigmac;
  37. p=1.5;
  38. q=2.2;
  39. sigmac=sqrt((q.^p)/2);
  40. yyi=sigmac*yyi;
  41. yyq=sigmac*yyq;
  42. xdata_1=(yyi1.*yyi1+yyq.*yyq).^(1/p);
  43. %%%%%%%%%%参数设定%%%%%%%%%%
  44. fr=1000; %雷达发射信号重频
  45. a=1;
  46. fs=4e5; %采样频率
  47. ts=1/fs;
  48. RCS=140;
  49. k=8.6*10E-5 ;
  50. sigma0=10*log10(RCS); %杂波后散射系数
  51. thetaE=2; %天线3db海拔带宽
  52. thetaA=1; %天线3db方位角带宽
  53. SL=-20; %天线旁瓣水平
  54. range_n=200;
  55. range_obj1=50;
  56. range_obj2=75;
  57. range_obj3=100;
  58. range=linspace(1,range_n,1000);
  59. hr=3; %雷达高度
  60. ht=3; %目标高度
  61. pt=75; %雷达峰值功率
  62. rang_obj1=range_obj1*1000; %目标距离
  63. rang_obj2=range_obj2*1000;
  64. rang_obj3=range_obj3*1000;
  65. t0=290; %有效噪声温度
  66. l=10; %雷达损耗
  67. ant_id=1; 
  68. clight=3.e8; %光速
  69. re=6371000; %地球半径
  70. t=1/fr;
  71. F=1;
  72. B=1e6;
  73. %%%%%%%%%%产生杂波回波%%%%%%%%%%
  74. lamda=clight/fr;
  75. thetaA_deg=thetaA;
  76. thetaE_deg=thetaE;
  77. thetaA=thetaA_deg*pi/180;
  78. thetaE=thetaE_deg*pi/180;
  79. rh=sqrt(8.0*hr*re/3.);
  80. SLv=10.0^(SL/10);
  81. sigma0v=10.0^(sigma0/10);
  82. tau=1/B;
  83. deltar=clight*tau/2.;
  84. range_m=1000.*range;
  85. thetar=asin(hr./range_m);
  86. thetae=asin((ht-hr)./range_m);
  87. propag_atten=1.+((range_m./rh).^4);
  88. Rg=range_m.*cos(thetar);
  89. deltaRg=deltar.*cos(thetar);
  90. theta_sum=thetae+thetar;
  91. if(ant_id==0)
  92. ant_arg=(2.78*theta_sum)./(pi*thetaE);
  93. gain=(sinc(ant_arg)).^2;
  94. else
  95. gain=exp(-2.776.*(theta_sum./thetaE).^2);
  96. end
  97. sigmac=(sigma0v.*Rg.*deltaRg).*(pi*SLv*SLv+thetaA.*gain.^2)./propag_atten;
  98. sigmac=10*log10(sigmac);
  99. %%%%%%%%%%回波幅度计算%%%%%%
  100. G=150;
  101. A1=sqrt(pt/(4*pi)^3*l)*G^2*lamda*sqrt(RCS)/rang_obj1^2;
  102. A2=sqrt(pt/(4*pi)^3*l)*G^2*lamda*sqrt(RCS)/rang_obj2^2;
  103. A3=sqrt(pt/(4*pi)^3*l)*G^2*lamda*sqrt(RCS)/rang_obj3^2;
  104. %%%%%%%%%%计算目标%%%%%%%%%%
  105. s_pc_1=[zeros(1,rang_obj1/range_n),A1,A1,A1,A1,A1,A1,A1,A1,A1,A1,zeros(1,((rang_obj2-rang_obj1)/range_n)-10),A2,A2,A2,A2,A2,A2,A2,A2,A2,A2,zeros(1,((rang_obj3-rang_obj2)/range_n)-10),A3,A3,A3,A3,A3,A3,A3,A3,A3,A3,zeros(1,(1000-rang_obj3/range_n)-10)]; 
  106.          s_pc=xdata_1+s_pc_1+sigmac;
  107.          Pn=sum(sum((xdata_1).^2));
  108.          snr=pt/Pn;
  109.         % SNR=pt*G^2*lamda^2*RCS/((4*pi)^2*(rang_obj)^4*k*t0*B*F*l);
  110. y=log(range_m);
  111. c=0.3;
  112. logG=c*y+log( s_pc);
  113. figure(1)
  114. plot(s_pc)
  115. grid
  116. %figure(2)
  117. %plot(logG)
  118. %grid
  119. N=1000;
  120. %第1点恒虚警处理时噪声均值由其后面的n点的噪声决定
  121. cfar_ca_result=zeros(1,N);
  122. cfar_ca_result(1,1)=s_pc(1,1)/(sqrt(2)/pi*mean(s_pc(1,2:17)));%估计值要乘一个门限加权系数T?
  123. %第2点到第n点恒虚警处理时噪声均值由其前面和后面的n点的噪声共同决定
  124. for i=2:16
  125.     noise_mean=sqrt(2)/pi*(mean(s_pc(1,1:i-1))+mean(s_pc(1,i+1:i+16)))/2;
  126.     cfar_ca_result(1,i)=s_pc(1,i)/noise_mean;
  127. end
  128. %正常数据点恒虚警处理时噪声均值由其前面和后面各n点的噪声共同决定
  129.     for i=17:N-17
  130.          noise_mean=sqrt(2)/pi*(mean(s_pc(1,i-16:i-1))+mean(s_pc(1,i+1:i+16)))/2;
  131.           cfar_ca_result(1,i)=s_pc(1,i)/noise_mean;
  132.     end
  133. %倒数n点到倒数第2点恒虚警处理时噪声均值由其前面n点和后面点的噪声共同决定
  134. for i=N-16:N-1
  135.     noise_mean=sqrt(2)/pi*(mean(s_pc(1,i-16:i-1))+mean(s_pc(1,i+1:N)))/2;
  136.    cfar_ca_result(1,i)=s_pc(1,i)/noise_mean;
  137. end
  138. %最后一点的恒虚警处理的噪声均值由其前面的n点的噪声决定
  139. noise_mean=sqrt(2)/pi*mean(s_pc(1,N-16:N-1));
  140. cfar_ca_result(1,N)=s_pc(1,N)/noise_mean;
  141.     
  142.  figure      
  143. plot(cfar_ca_result,'g');grid
  144. xlabel('N'),ylabel('信号幅度'),title('采用CA处理的结果');