相控阵天线均匀面阵方向图(六)-----方向图函数的不同表达形式

基本问题

    如何通过不同的表达式得到均匀面阵的方向图

源代码

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%   均匀面阵方向图的三种不同的表达式
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

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)=45,180)
theta0=45;
fine0=180;
theta=1:1:90;   % 俯仰角取值范围
fine=1:1:360;   % 方位角取值范围
x=d*(0:M-1);
y=d*(0:N-1);
z=0; % 阵元位置(x,y,z)


r=0;f1=[];f2=[];f3=[];

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%           第一种表达式
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
for i=1:length(theta)      % 俯仰角取值范围
    for j=1:length(fine)   % 方位角取值范围
        % 64个阵元功率叠加
        for p=1:M  % x
            for q=1:N  % y
                position=[x(p) y(q) 0]; %阵元的位置坐标
                direction_vector0=[sind(theta0)*cosd(fine0) sind(theta0)*sind(fine0) cosd(theta0)];
                direction_vector=[sind(i) * cosd(j)  sind(i) * sind(j) cosd(i)]; % 单位方向矢量
                 w=exp(1i*position*direction_vector0.'/c*2*pi*f); % 权值
                 v=exp(1i*position*direction_vector.'/c*2*pi*f);  % 相对于原点接收到的归一化的信号
                 r=r+w'*v;  % 64个阵元功率叠加    '表示共轭转置   .'表示转置
%                  r=r+exp(1i*2*pi/lamda*(x(p)*(sind(i) * cosd(j)-sind(theta0)*cosd(fine0))  + y(q)* (sind(i) * sind(j)-sind(theta0)*sind(fine0)) )  );
            end
        end
        f1(i,j)=r; %64个阵元的合成场强放到对应的扫描角度上
        r=0;      % 每扫描一个角度时,将上一个角度的64个阵元功率清0
    end
end
F1=abs(f1);      % 取实部
figure(1)
mesh(fine,theta,F1);
xlabel('方位角');ylabel('俯仰角');zlabel('方向图');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%           第二种表达式
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
for i=1:length(theta)      % 俯仰角取值范围
    for j=1:length(fine)   % 方位角取值范围
        % 64个阵元功率叠加
        for p=1:M  % x
            for q=1:N  % y
                 r=r+exp(1i*2*pi/lamda*(x(p)*(sind(i) * cosd(j)-sind(theta0)*cosd(fine0))  + y(q)* (sind(i) * sind(j)-sind(theta0)*sind(fine0)) )  );
            end
        end
        f2(i,j)=r; %64个阵元的合成场强放到对应的扫描角度上
        r=0;      % 每扫描一个角度时,将上一个角度的64个阵元功率清0
    end
end
F2=abs(f2);      % 取实部
figure(2)
mesh(fine,theta,F2); hold on;
xlabel('方位角');ylabel('俯仰角');zlabel('方向图'); 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%           第三种表达式
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
for i=1:length(theta)      % 俯仰角取值范围
    for j=1:length(fine)   % 方位角取值范围
        t1(i,j)=2*pi/lamda*d*( sind(i) * cosd(j) - sind(theta0)*cosd(fine0) );
        F1(i,j)=sin(M/2*t1(i,j))/sin(1/2*t1(i,j));
        t2(i,j)=2*pi/lamda*d*( sind(i) * sind(j) - sind(theta0)*sind(fine0) );
        F2(i,j)=sin(N/2*t2(i,j))/sin(1/2*t2(i,j));
        f3(i,j)= F1(i,j)*F2(i,j);
    end
end
F3=abs(f3);% 取实部
figure(3)
mesh(fine,theta,F3);
xlabel('方位角');ylabel('俯仰角');zlabel('方向图');


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%4种表达式
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                 权值
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
W =[];
for m=1:M
    for n=1:N
        x = (m-1)*sind(theta0)*cosd(fine0)+(n-1)*sind(theta0)*sind(fine0)+0;% 波程差
        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:M
             for n=1:N
                 %-------权值扫描
                 x = (m-1)*sind(theta(p))*cosd(fine(q))+(n-1)*sind(theta(p))*sind(fine(q));
                 V(m,n) = exp(1j*2*pi*f*d*x/c); %  方向矢量的求解
             end
        end
        V1=reshape(V,[],1); %8*8的矩阵变成64*1的向量
        
        E(p,q)=W1'*V1;% 相控阵天线的方向图
        E(p,q)=abs(E(p,q));

    end
end
figure(4)
mesh(fine,theta,E);
xlabel('方位角');ylabel('俯仰角');zlabel('方向图');



仿真结果

相控阵天线均匀面阵方向图(六)-----方向图函数的不同表达形式_第1张图片
相控阵天线均匀面阵方向图(六)-----方向图函数的不同表达形式_第2张图片

你可能感兴趣的:(matlab)