微信公众号:EW Frontier QQ交流群:949444104
主要内容
PDA、FDA MATLAB代码
%----------------------------------------
%功能:FDA和相控阵天线方向图
%版本:ver1.0
%时间:2017.11.1
%---------------------------------------
clear all;
clc;
disp('相控阵天线方向图请输入:1');
disp('频控阵天线方向图请输入:0');
flag=input('输入:');
close all;
%相控阵天线方向图
if flag == 1
disp('%相控阵天线方向图');
N = 12;
alfa = -160*pi/180:0.1*pi/180:160*pi/180;
beta = 0*pi/180;
len = length(alfa);
falfabeta = zeros(1, len);
for i=1:len
if abs( sin(alfa(i)) - sin(beta) )<= 1e-6;
falfabeta(i) = N;
continue;
else
falfabeta(i) = sin( N*pi/2*( sin(alfa(i)) - sin(beta) ) )/sin( pi/2*( sin(alfa(i)) - sin(beta) ) );
end
end
alfa = alfa*180/pi;
figure;
plot(alfa, falfabeta);
title('未归一相控阵方向图');
ylabel('幅度');
xlabel('方位角(°)');
fimagesec = falfabeta;
falfabeta = abs(falfabeta/max(abs(falfabeta)));
figure;
plot(alfa, falfabeta);
title('归一化相控阵方向图');
ylabel('归一化幅度');
xlabel('方位角(°)');
figure;
title('相控阵方向图');
x=[-60 60];
y=[-4 12];
clims = [-3 N];
imagesc(x,y,fimagesec,clims);
colormap(jet);
colorbar
figure;
falfabeta = N*falfabeta;
clims = [0 N];
imagesc(x,y,falfabeta,clims);
colormap(jet);
colorbar
else
disp('%频控阵天线方向图');
N = 12;%调节线条粗细
alfa = -80*pi/180:0.01:80*pi/180;
len = length(alfa);
range = 20e4-1:-(20e4/len):0;
falfabeta = zeros(len, len);
f0 =10e9;
c = 3e8;
d = c/(2*f0);
deltaf = 3e3;
t = 0;
for i=1:len
for j=1:len
if abs(sin( pi*( deltaf*t - deltaf*range(i)/c + sin(alfa(j))/(2) ) )) <= 1e-6 ;
falfabeta(i,j) = N;
continue;
else
falfabeta(i,j) = abs(sin( N*pi*( deltaf*t - deltaf*range(i)/c - sin(alfa(j))/2 ) )...
/ sin( pi*( deltaf*t - deltaf*range(i)/c - sin(alfa(j))/2 ) )) ;
end
end
end
% figure,polar3d(alfa, range,(falfabeta));
figure;
mesh(alfa,range,(falfabeta));
figure;
x=[-80 80];
y=[1 2e4];
clims = [-3 N];
imagesc(x,y,falfabeta,clims);
colormap(jet);
colorbar
end