DFT波束形成

fpga&matlab發表於2020-12-22

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(S32);

 

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))

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 

相關文章