close all;
clear all;
clc;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 参数定义
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
c=3e8;
f=10e9; % 信号频率
lamda=c/f; % 长
d=lamda/2; % 阵元间距 7mm 根据辐射信号频率定
bujing=0.1;
theta=-90:bujing:90;
theta0=0;
L=length(theta); % 采样点数
N=16; % 阵元个数
NFFT=2048; % FFT点数
g=ones(1,N);
% 原方向图
[F0] = Beam_F(N,d,theta0,c,f,theta,g);
figure(1)
plot(theta,abs(F0));
title('原方向图');
% 补0后的原方向图
F=[F0 zeros(1,NFFT-length(theta)) ];
% 对方向图做FFT,得到权值
% F不取abs
Am=fft(F,NFFT);
Am=abs(Am);
Am=Am(1:N);
% F取abs
Am_abs=fft(abs(F),NFFT);
Am_abs=abs(Am_abs);
Am_abs=Am_abs(1:N);
figure(2)
plot(Am,'-r*');hold on;
plot(Am_abs,'-bo');hold on;
legend('F不取绝对值','F取绝对值');
% 对权值做ifft,得到方向图
F=abs(fftshift(ifft(Am,length(theta))));
F2=abs(fftshift(ifft(Am_abs,length(theta))));
figure(3)
plot(F,'-r*');hold on;
plot(F2,'-bo');hold on;
legend('F不取绝对值','F取绝对值');
02-29
354
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)