sa_fig4_19.m
来自「这个是英文版<<Smart Antennas for Wireles」· M 代码 · 共 41 行
M
41 行
%Smart antennas figure 4.19 kaiser-bessel weights on a linear arra
d=.5;
N=input('what is the number of elements?');
theta=-pi/2:.01:pi/2;
ang=theta*180/pi;
test=kaiser(N,3);
check=mod(N,2)
if check == 0
wB=flipud(test(1:N/2));
wB=wB/max(wB);
figure;
stem(test/max(test),'k')
xlabel('Element Number')
ylabel('Array Weights')
axis([1 N 0 1.1])
AF=[zeros(1,length(theta))];
tot=sum(wB);
for i=1:N/2
AF=AF+wB(i)*cos((2*i-1)*pi*d*(sin(theta)));
end
else
wB=flipud(test(1:(N-1)/2+1));
wB=wB/max(wB);
figure;
stem(test/max(test),'k')
xlabel('Element Number')
ylabel('Array Weights')
axis([1 N 0 1.1])
AF=[zeros(1,length(theta))];
tot=sum(wB);
for i=1:(N-1)/2+1
AF=AF+wB(i)*cos(2*(i-1)*pi*d*sin(theta));
end
end
AFn=sin(N*pi*d*sin(theta))./(N*pi*d*sin(theta));
figure;plot(ang,abs(AF)/tot,'k', ang,abs(AFn),'k:')
axis([-90 90 0 1.1])
set(gca,'xTick',[-90:30:90])
xlabel('\theta')
ylabel('|AF|')
grid on
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?