%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 均匀面阵方向图的三种不同的表达式
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%clc;
close all;
clear all;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 参数设置
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% theta是俯仰角 fine是方位角
c=3e8; % 光速
f=3e10; % 载波频率
lamda=c/f; % 波长
d=lamda/2; % 阵元间距
M=8;
N=8; % 8*8的矩阵
% 波束指向角度(theta0,fine0)
theta0=30;
fine0=200;
bujing=0.5;
theta=0:bujing:90; % 俯仰角取值范围
fine=0:bujing:360; % 方位角取值范围%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 第1种表达式
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%-----------权值
W =[];
for m=1:Mfor n=1:Nx = (m-1)*sind(theta0)*cosd(fine0)+(n-1)*sind(theta0)*sind(fine0);% 波程差W(m,n) = exp(1j*2*pi*f*d*x/c); end
end
W1=reshape(W,[],1); % 将8*8的矩阵变成64*1的向量%---------方向矢量计算
E=[];
for p = 1:length(theta)for q = 1:length(fine) for m=1:Mfor n=1:N%-------权值扫描x = (m-1)*d*sind(theta(p))*cosd(fine(q))+(n-1)*d*sind(theta(p))*sind(fine(q));V(m,n) = exp(1j*2*pi*f*x/c); % 方向矢量的求解endendV1=reshape(V,[],1); % 将8*8的矩阵变成64*1的向量E1(p,q)=W1'*V1;% 相控阵天线的方向图Beam_F1(p,q)=abs(E1(p,q));end
end
figure(4)
mesh(fine,theta,Beam_F1);
xlabel('方位角');ylabel('俯仰角');zlabel('方向图');%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 第二种表达式
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
for p=1:length(theta) % 俯仰角取值范围for q=1:length(fine) % 方位角取值范围% 64个阵元功率叠加for m=1:M for n=1:N r(m,n)=exp(1i*2*pi/lamda*( (m-1)*d*(sind(theta(p))*cosd(fine(q))-sind(theta0)*cosd(fine0))...+(n-1)*d*(sind(theta(p))*sind(fine(q))-sind(theta0)*sind(fine0)) ) );endendE(p,q)=sum(sum(r)); % 将64个阵元的合成场强放到对应的扫描角度上end
end
Beam_F2=abs(E); % 取实部
figure(2)
mesh(fine,theta,Beam_F2); hold on;
xlabel('方位角');ylabel('俯仰角');zlabel('方向图'); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 第三种表达式
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
for p=1:length(theta) % 俯仰角取值范围for n=1:length(fine) % 方位角取值范围t1=2*pi/lamda*d*( sind(theta(p)) * cosd(fine(n)) - sind(theta0)*cosd(fine0) );beam1(p,n)=sin(M/2*t1)/sin(1/2*t1);t2=2*pi/lamda*d*( sind(theta(p)) * sind(fine(n)) - sind(theta0)*sind(fine0) );beam2(p,n)=sin(N/2*t2)/sin(1/2*t2);f3(p,n)= beam1(p,n)*beam2(p,n);end
end
Beam_F3=abs(f3);% 取实部
figure(3)
mesh(fine,theta,Beam_F3);
xlabel('方位角');ylabel('俯仰角');zlabel('方向图');max(max(Beam_F1-Beam_F2))
max(max(Beam_F1-Beam_F3))
max(max(Beam_F2-Beam_F3))