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

matlab例程

开发平台:

Matlab

  1. %%%%%%%%%%瑞丽噪声%%%%%%%%%%
  2. sigma=2;
  3. u=rand(1,1000);
  4. rayleigh_noise=sqrt(2*log2(1./u))*sigma;
  5. %%%%%%%%%%参数设定%%%%%%%%%%
  6. fr=1000; %雷达发射信号重频
  7. a=1;
  8. fs=4e5; %采样频率
  9. ts=1/fs;
  10. RCS=140;
  11. k=8.6*10E-5 ;
  12. sigma0=10*log10(RCS); %杂波后散射系数
  13. thetaE=2; %天线3db海拔带宽
  14. thetaA=1; %天线3db方位角带宽
  15. SL=-20; %天线旁瓣水平
  16. range_n=200;
  17. range_obj1=50;
  18. range_obj2=75;
  19. range_obj3=100;
  20. range=linspace(1,range_n,1000);
  21. hr=3; %雷达高度
  22. ht=3; %目标高度
  23. pt=75; %雷达峰值功率
  24. rang_obj1=range_obj1*1000; %目标距离
  25. rang_obj2=range_obj2*1000;
  26. rang_obj3=range_obj3*1000;
  27. t0=290; %有效噪声温度
  28. l=10; %雷达损耗
  29. ant_id=1; 
  30. clight=3.e8; %光速
  31. re=6371000; %地球半径
  32. t=1/fr;
  33. F=1;
  34. B=1e6;
  35. %%%%%%%%%%产生杂波回波%%%%%%%%%%
  36. lamda=clight/fr;
  37. thetaA_deg=thetaA;
  38. thetaE_deg=thetaE;
  39. thetaA=thetaA_deg*pi/180;
  40. thetaE=thetaE_deg*pi/180;
  41. rh=sqrt(8.0*hr*re/3.);
  42. SLv=10.0^(SL/10);
  43. sigma0v=10.0^(sigma0/10);
  44. tau=1/B;
  45. deltar=clight*tau/2.;
  46. range_m=1000.*range;
  47. thetar=asin(hr./range_m);
  48. thetae=asin((ht-hr)./range_m);
  49. propag_atten=1.+((range_m./rh).^4);
  50. Rg=range_m.*cos(thetar);
  51. deltaRg=deltar.*cos(thetar);
  52. theta_sum=thetae+thetar;
  53. if(ant_id==0)
  54. ant_arg=(2.78*theta_sum)./(pi*thetaE);
  55. gain=(sinc(ant_arg)).^2;
  56. else
  57. gain=exp(-2.776.*(theta_sum./thetaE).^2);
  58. end
  59. sigmac=(sigma0v.*Rg.*deltaRg).*(pi*SLv*SLv+thetaA.*gain.^2)./propag_atten;
  60. sigmac=10*log10(sigmac);
  61. %%%%%%%%%%回波幅度计算%%%%%%
  62. G=150;
  63. A1=sqrt(pt/(4*pi)^3*l)*G^2*lamda*sqrt(RCS)/rang_obj1^2;
  64. A2=sqrt(pt/(4*pi)^3*l)*G^2*lamda*sqrt(RCS)/rang_obj2^2;
  65. A3=sqrt(pt/(4*pi)^3*l)*G^2*lamda*sqrt(RCS)/rang_obj3^2;
  66. %%%%%%%%%%计算目标%%%%%%%%%%
  67. 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)];  
  68. s_pc=rayleigh_noise+s_pc_1+sigmac;
  69. Pn=sum(sum((rayleigh_noise).^2));
  70. snr=pt/Pn;
  71. figure
  72. plot(s_pc)
  73. grid
  74. N=1000;
  75. %第1点恒虚警处理时噪声均值由其后面的n点的噪声决定
  76. cfar_ca_result=zeros(1,N);
  77. cfar_ca_result(1,1)=s_pc(1,1)/(sqrt(2)/pi*mean(s_pc(1,2:17)));%估计值要乘一个门限加权系数T?
  78. %第2点到第n点恒虚警处理时噪声均值由其前面和后面的n点的噪声共同决定
  79. for i=2:16
  80.     noise_mean=sqrt(2)/pi*(mean(s_pc(1,1:i-1))+mean(s_pc(1,i+1:i+16)))/2;
  81.     cfar_ca_result(1,i)=s_pc(1,i)/noise_mean;
  82. end
  83. %正常数据点恒虚警处理时噪声均值由其前面和后面各n点的噪声共同决定
  84.     for i=17:N-17
  85.          noise_mean=sqrt(2)/pi*(mean(s_pc(1,i-16:i-1))+mean(s_pc(1,i+1:i+16)))/2;
  86.           cfar_ca_result(1,i)=s_pc(1,i)/noise_mean;
  87.     end
  88. %倒数n点到倒数第2点恒虚警处理时噪声均值由其前面n点和后面点的噪声共同决定
  89. for i=N-16:N-1
  90.     noise_mean=sqrt(2)/pi*(mean(s_pc(1,i-16:i-1))+mean(s_pc(1,i+1:N)))/2;
  91.    cfar_ca_result(1,i)=s_pc(1,i)/noise_mean;
  92. end
  93. %最后一点的恒虚警处理的噪声均值由其前面的n点的噪声决定
  94. noise_mean=sqrt(2)/pi*mean(s_pc(1,N-16:N-1));
  95. cfar_ca_result(1,N)=s_pc(1,N)/noise_mean;
  96.     
  97. figure       
  98. plot(cfar_ca_result,'g');grid
  99. xlabel('N'),ylabel('信号幅度'),title('采用CA处理的结果');