波束形成 Matlab程序 - 百度文库 ر

ҵ

%Ӧγɷͼ clc;

clear all; close all; ima=sqrt(-1);

element_num=8; %Ԫ c=3e8; f=500e6; lamda=c/f;

d=1/2*lamda; %Ԫ벨Ĺϵ theta=-90:0.5:90; %Χ theta0=0; % theta1=45; %ŷ theta2=60; %ŷ L=512; %Ԫ for i=1:L;

amp0=10*randn(1);%źŵķ֤ź֮Dzص amp1=100*randn(1); amp2=100*randn(1); ampn=10;

x(:,i)=amp0*exp(ima*2*pi*1/2*sin(theta0*pi/180)*[0:element_num-1]')+... amp1*exp(ima*2*pi*1/2*sin(theta1*pi/180)*[0:element_num-1]')+... amp2*exp(ima*2*pi*1/2*sin(theta2*pi/180)*[0:element_num-1]')+...

ampn*(randn(element_num,1)+ima*randn(element_num,1));%ź end

Rx=1/L*x* x';

steer1=exp(ima*2*pi*1/2*sin(theta0*pi/180)*[0:element_num-1]') steer2=exp(ima*2*pi*1/2*sin(theta1*pi/180)*[0:element_num-1]') steer3=exp(ima*2*pi*1/2*sin(theta2*pi/180)*[0:element_num-1]') C=[steer1 steer2 steer3];

F=[1 0 0]';%0ȷΪ w=inv(Rx)*C*(inv(C'*inv(Rx)*C))*F; for j=1:length(theta);

a=exp(ima*2*pi*1/2*sin(theta(j)*pi/180)*[0:element_num-1]'); f(j)=w'*a;

p(j)=1/(a'*inv(Rx)*a); end

F=20*log10(abs(f)/(max(max(abs(f)))));

P=20*log10(abs(p)/(max(max(abs(p)))));%˴ǹʵĶʽ figure

subplot(121)

plot(theta,P),grid on,hold on xlabel('theta/o');

ylabel('F/dB');

title('źŷͼ') axis([-90 90 -50 0]); subplot(122)

plot(theta,F),grid on,hold on; plot(theta0,-50:0,'.') plot(theta1,-50:0,'.') plot(theta2,-50:0,'.') xlabel('theta/o');

ylabel('/dB');axis([-90 90 -50 0]); title('Ӧγɷͼ') ͼ£

L=2048ʱͼ£

L=2048ʱͼ£

L=512Ϊ

amp0=10*randn(1); amp1=200*randn(1); amp2=200*randn(1);

ampn=10;ʱͼ£