www.pudn.com > DBF_oneANDtwo.zip > dbf2.m, change:2015-06-14,size:872b


function [deg,result]=dbf2(M,N,xishu) 
ratio=1; 
if xishu==1 
    ratio=N; 
end 
 
a=zeros(1,M); 
delta=2*pi*sin(pi/3.6)*ratio/2;%阵元间距最短为半波长 
for m=1:M 
    a(1,m)=exp(-1j*(m-1)*delta); 
end 
 
deltb=2*pi*sin(pi/6)/2; 
b=zeros(1,N); 
for n=1:N 
    b(1,n)=exp(-1j*(n-1)*deltb); 
end 
ab=kron(a,b); 
 
deltfi=-pi/3:pi/300:pi/3; 
afi=zeros(length(deltfi),M*N,length(deltfi)); 
fi=zeros(1,N); 
for q=1:length(deltfi) 
    for q2=1:length(deltfi) 
        for m=1:M 
            a(1,m)=exp(-1j*(m-1)*2*pi*sin(deltfi(q2))*ratio/2); 
        end 
         
        for n=1:N 
            fi(1,n)=exp(-1j*(n-1)*2*pi*sin(deltfi(q))/2); 
        end 
    afi(q2,:,q)=kron(a,fi); 
    end 
end 
 
[A,B,C]=size(afi); 
result=zeros(A,C); 
for m=1:C 
    result(m,:)=ab*afi(:,:,m)'; 
end 
result=result/max(max(abs(result))); 
result=20*log10(result); 
deg=deltfi*180/pi;