pltdefaults %%% 10lambda aperture with different d values figure(1) L=10; % aperture dlambdas=[.25 .5 1 2]; for ind=1:length(dlambdas); dlam=dlambdas(ind); M=L/dlam; % number of elements c=sqrt(1/M)*ones(M,1); % uniform weighting phivec=-90:.5:90; BP=beampattern(c,dlam,phivec); subplot(2,2,ind) plot(phivec,20*log10(abs(BP))); axis([-90 90 -40 0]) xlabel('Angle (deg)') ylabel('Power (dB)') tstr=sprintf('d=%0.2f',dlam); title([tstr '\lambda']) end %%% d=0.5lambda with 4 different apertures figure(2) dlam=.5; apertures=[2 4 8 16]; for ind=1:length(apertures) M=apertures(ind)/dlam; % number of elements c=sqrt(1/M)*ones(M,1); % uniform weighting phivec=-90:.5:90; BP=beampattern(c,dlam,phivec); subplot(2,2,ind) plot(phivec,20*log10(abs(BP))); axis([-90 90 -40 0]) xlabel('Angle (deg)') ylabel('Power (dB)') tstr=sprintf('L=%0.0f',apertures(ind)); title([tstr '\lambda']) end %%% Dolph-Chebychev tapered examples figure(3) dlam=.5; L=10; M=L/dlam; % number of elements c=ones(M,1); % uniform weighting cnotaper=1/sqrt(M)*c; win=chebwin(M,50); win=win/sqrt(win'*win); ccheby50=win.*c; win=chebwin(M,70); win=win/sqrt(win'*win); ccheby70=win.*c; phivec=-90:.5:90; BPnotaper=beampattern(cnotaper,dlam,phivec); BPcheby50=beampattern(ccheby50,dlam,phivec); BPcheby70=beampattern(ccheby70,dlam,phivec); plot(phivec,20*log10(abs(BPnotaper)),'b-',... phivec,20*log10(abs(BPcheby50)),'r--',... phivec,20*log10(abs(BPcheby70)),'k-.'); axis([-90 90 -90 0]) xlabel('Angle (deg)') ylabel('Power (dB)') apstr=[sprintf('L=%0.0f',L) '\lambda']; dlamstr=[sprintf('d=%0.2f',dlam) '\lambda']; title([apstr ' ' dlamstr]) legend('No taper','Dolph-Chebychev -50','Dolph-Chebychev -70') %%% Steered examples figure(4) dlam=.5; L=10; M=L/dlam; % number of elements phis0=0; phis45=45; phis90=90; mvec=(0:M-1)'; uvec=dlam*sin(pi*phis0/180); vphis0=1/sqrt(M)*exp(-j*2*pi*mvec*uvec); c0=vphis0; uvec=dlam*sin(pi*phis45/180); vphis45=1/sqrt(M)*exp(-j*2*pi*mvec*uvec); c45=vphis45; uvec=dlam*sin(pi*phis90/180); vphis90=1/sqrt(M)*exp(-j*2*pi*mvec*uvec); c90=vphis90; phivec=-90:.5:90; BP0=beampattern(c0,dlam,phivec); BP45=beampattern(c45,dlam,phivec); BP90=beampattern(c90,dlam,phivec); plot(phivec,20*log10(abs(BP0)),'b-',... phivec,20*log10(abs(BP45)),'r--',... phivec,20*log10(abs(BP90)),'k-.'); axis([-90 90 -40 0]) xlabel('Angle (deg)') ylabel('Power (dB)') apstr=[sprintf('L=%0.0f',L) '\lambda']; dlamstr=[sprintf('d=%0.2f',dlam) '\lambda']; title([apstr ' ' dlamstr]) legend('0 deg steering','45 deg steering','90 degree steering',2)