clc
clear
N=32;
d=1;
lamada=2*d;
theta=-pi/2:pi/720:pi/2;
fai=2*pi/lamada*d*sin(theta);
k=0:N-1;
S=exp(1j*k'*fai);
theta_yi=pi/6; %Ö÷¼«´óÖµ±»¿ØµÄ·½Ïò
r=round(N*d/lamada*sin(theta_yi))+1;%µÚrÁÐΪÖ÷²¨Êø¿Øµ½pi/6µÄ²¨Êøͼ
Ar=fft(S,32);
plot(theta*180/pi,abs(Ar(r,:)))
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
注:程序中做了32点FFT,原理上可以做更多点FFT,使主波束相控到更多的方向。
程序:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clc
clear
N=32;
d=1;
lamada=2*d;
theta1=-pi/6; %主波束方向
beta=2*pi/lamada*d*sin(theta1);
k=0:N-1;
S=exp(1j*k*beta);
Ar=fft(S,256);
Ar=[Ar(130:256) Ar(1:129)];
fai=0:pi/128:2*pi-pi/128; %对应fai值
fai=[(fai(130:256)-2*pi) fai(1:129)];
theta=asin(fai*lamada/(2*pi*d));
plot(theta*180/pi,abs(Ar))
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%