%本程序用于雷达球坐标系到正弦空间坐标系的转换,以及相控阵雷达的波位编排。070129, by goodtony.
0228添加波位数据保存 clear all close all clc
%波束宽度,单位:度 BeamWidth = 3.6;
theta05 = round(sin(BeamWidth*pi/180)*1000)/1000; %雷达作用空域
AZ = [-15 15]; %方位角范围(雷达球坐标系),单位:度 EL = [0 30]; %俯仰角范围(雷达球坐标系),单位:度 %阵面倾角,单位:度 thetaT
=
atan(-(cos(EL(1)*pi/180)
-
cos(EL(2)*pi/180))/(sin(EL(1)*pi/180)
sin(EL(2)*pi/180))*cos(AZ(2)*pi/180))*180/pi; %左边界 az = AZ(1); el = EL(1):EL(2);
alpha1 = cos(el*pi/180)*sin(az*pi/180); beta1
sin(el*pi/180)*cos(thetaT*pi/180)-cos(el*pi/180)*cos(az*pi/180)*sin(thetaT*pi/180); %右边界
-
=
az = AZ(2); el = EL(1):EL(2);
alpha2 = cos(el*pi/180)*sin(az*pi/180); beta2
sin(el*pi/180)*cos(thetaT*pi/180)-cos(el*pi/180)*cos(az*pi/180)*sin(thetaT*pi/180); %下边界 az = AZ(1):AZ(2); el = EL(1);
alpha3 = cos(el*pi/180)*sin(az*pi/180); beta3
sin(el*pi/180)*cos(thetaT*pi/180)-cos(el*pi/180)*cos(az*pi/180)*sin(thetaT*pi/180); %上边界 az = AZ(1):AZ(2); el = EL(2);
alpha4 = cos(el*pi/180)*sin(az*pi/180); beta4
sin(el*pi/180)*cos(thetaT*pi/180)-cos(el*pi/180)*cos(az*pi/180)*sin(thetaT*pi/180);
lowup = max(beta3); lowest = min(beta3);
rightest = max(alpha3) + theta05/2; leftest = min(alpha3) - theta05/2;
=
= = upest = max(beta4); uplow = min(beta4);
figure(1),plot(alpha1,beta1,'r');axis([ leftest-0.1 rightest+0.05 lowest-0.05 upest+0.1]);hold on;grid on;
title('雷达波束在正弦空间的编排');xlabel('alpha(rad)');ylabel('beta(rad)'); plot(alpha2,beta2,'r'); plot(alpha3,beta3,'r'); plot(alpha4,beta4,'r'); % pause(0.1)
%========================================================================== BoweiNumber = 0;
Mx = 2*round(rightest/theta05)-1;
My = round((upest - lowest)/(0.866*theta05)); arr_x0 = zeros(My,Mx); %波位坐标(方位角) arr_y0 = zeros(My,Mx); %波位坐标(俯仰角) arr_NboweiRow = zeros(My,1); %每一行的波位数目 %---------------奇数行------------------------ m = 0;
for y0 = lowest+theta05/2: 2*0.866*theta05 : upest m = m + 1;
n = 0; NboweiRow = 0;
for x0 = 0:theta05:rightest n = n + 1;
x = (-theta05/2:0.001:theta05/2) + x0;
y1 = sqrt((theta05/2)^2 - (x - x0).^2) + y0; y2 = -sqrt((theta05/2)^2 - (x - x0).^2) + y0; % alpha2,beta2:右边界 flag = 0;
[minValueminSite] = min(abs(beta2 - y0)); if alpha2(minSite) + theta05/2 >= x0 flag = 1; end if y0 % alpha3,beta3:下边界 [minValueminSite] = min(abs(alpha3 - x0)); if beta3(minSite) > y0 flag = 0; end end if y0 >uplow % alpha4,beta4:上边界 [minValueminSite] = min(abs(alpha4 - x0)); if beta4(minSite) + theta05/2 <= y0 flag = 0; end end if flag == 1 NboweiRow = NboweiRow + 1; plot(x,real(y1)); plot(x,real(y2)); pause(0.01) BoweiNumber = BoweiNumber + 1; arr_x0((m-1)*2+1,round(Mx/2)+n) = x0; arr_y0((m-1)*2+1,round(Mx/2)+n) = y0; end end arr_NboweiRow( (m-1)*2 + 1 ) = NboweiRow; end m = 0; for y0 = lowest+theta05/2 : 2*0.866*theta05 : upest m = m + 1;