sa_fig4_28.m

来自「这个是英文版<<Smart Antennas for Wireles」· M 代码 · 共 63 行

M
63
字号
%kaiser weighted planar square array.   N elements in the x and in the y directions
%  spacing dx=dy=d.   Kaiser bessel weights with alpha=3.  
%  Beamsteered to theta0=45, phi0=45.
d=.5;
N=16; 
th0=pi/6;
ph0=pi/4;
th1=pi/4;
ph1=pi/3;
th2=pi/4;
ph2=pi/6;
th=[0:150]*pi/300;
ph=[0:150]*2*pi/150;
[Th,Ph]=meshgrid(th,ph);
AFn=[zeros(151,151)];
test=kaiser(N,3);
wB=test/max(test);

AFx=[zeros(151,151)];
AFy=[zeros(151,151)];
tot=sum(wB);
for i=1:N
    AFx=AFx+wB(i)*exp(-1j*(i-1)*2*pi*d*(sin(Th).*cos(Ph)-sin(th0).*cos(ph0)));
    AFy=AFy+wB(i)*exp(-1j*(i-1)*2*pi*d*(sin(Th).*sin(Ph)-sin(th0).*sin(ph0)));
end
maxx=max(max(abs(AFx)));
maxy=max(max(abs(AFy)));
AF0=AFx.*AFy/(maxx*maxy);
AFx=[zeros(151,151)];
AFy=[zeros(151,151)];
for i=1:N
    AFx=AFx+wB(i)*exp(-1j*(i-1)*2*pi*d*(sin(Th).*cos(Ph)-sin(th1).*cos(ph1)));
    AFy=AFy+wB(i)*exp(-1j*(i-1)*2*pi*d*(sin(Th).*sin(Ph)-sin(th1).*sin(ph1)));
end
maxx=max(max(abs(AFx)));
maxy=max(max(abs(AFy)));
AF1=AFx.*AFy/(maxx*maxy);
AFx=[zeros(151,151)];
AFy=[zeros(151,151)];
for i=1:N
    AFx=AFx+wB(i)*exp(-1j*(i-1)*2*pi*d*(sin(Th).*cos(Ph)-sin(th2).*cos(ph2)));
    AFy=AFy+wB(i)*exp(-1j*(i-1)*2*pi*d*(sin(Th).*sin(Ph)-sin(th2).*sin(ph2)));
end
maxx=max(max(abs(AFx)));
maxy=max(max(abs(AFy)));
AF2=AFx.*AFy/(maxx*maxy);
AFn=(AF0+AF1+AF2);
%AFn=AFx.*AFy/tot^2;
x=abs(AFn).*sin(Th).*cos(Ph);
y=abs(AFn).*sin(Th).*sin(Ph);
z=abs(AFn).*cos(Th);
figure;
mesh(x,y,z)
colormap([0 0 0])
axis equal
view(118,22)
xlabel('x')
ylabel('y')
zlabel('z')
zoom(1.5)
grid off
axis off

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?