资源简介
远场 近场 聚焦波束形成(beamforing) 矢量水听器 常规波束形成 MVDR波束形成
代码片段和文件信息
%------------矢量水听器 近场 远场 常规波束形成 MVDR-----0722-----
clc
clear all
close all
%-----------信号模型--------------
M=12;
N=1024;
f0=1000;
fs=10*f0;
c=1500;
lamda=c/f0;
w=2*pi*f0;
k=w/c;
d=lamda/2;
t=0:N-1;
snr=input(‘信噪比snr=‘);
theta=input(‘入射角度theta=‘);
theta=theta*pi/180;
A=sqrt(2*10^(snr/10));
s=A*exp(-j*w*t/fs);
%----------远场 波束形成--------------
for m=1:M
Sp(m:)=A*exp(-j*(w*t/fs+k*(m-1)*d*cos(theta)))+randn(size(t))/3;
Sx(m:)=A*exp(-j*(w*t/fs+k*(m-1)*d*cos(theta)))*cos(theta)+randn(size(t))/3;
Sy(m:)=A*exp(-j*(w*t/fs+k*(m-1)*d*cos(theta)))*sin(theta)+randn(size(t))/3;
end
S=[Sp.‘Sx.‘Sy.‘];
R=cov(S);
theta1=-180:180;
for i=1:length(theta1)
for m=1:M
Wp(m)=exp(-j*k*(m-1)*d*cos(theta1(i)*pi/180));
Wx(m)=exp(-j*k*(m-1)*d*cos(theta1(i)*pi/180))*cos(theta1(i)*pi/180);
Wy(m)=exp(-j*k*(m-1)*d*cos(theta1(i)*pi/180))*sin(theta1(i)*pi/180);
end
W=[WpWxWy];
P(i)=W*R*W‘;
Pm(i)=1/(W*(R^-1)*W‘);
end
%-----------归一化-----------------
pp=max(abs(P));
P=20*log10(P/pp);
ppm=max(abs(Pm));
Pm=20*log10(Pm/ppm);
%----------------------------------
figure
plot(theta1P);
title(‘远场 常规算法波束形成‘)
xlabel(‘x/角度°‘)
ylabel(‘y/dB‘)
%-----------------------------------
figure
plot(theta1Pm);
title(‘远场 MVDR算法波束形成‘)
xlabel(‘x/角度°‘)
ylabel(‘y/dB‘)
%------------------------------------
figure
plot(theta1P‘r-‘theta1Pm‘b:‘);
title(‘远场 常规与MVDR算法波束形成‘);
xlabel(‘x/角度°‘);
ylabel(‘y/dB‘);
legend(‘常规算法‘‘MVDR算法‘);
%----------近场 波束形成--------------
% x0=15;
% y0=20;
x0=input(‘目标位置x0=‘);
y0=input(‘目标位置y0=‘);
for m=1:M
theta2(m:)=atan(y0/(x0-(m-1)*d));
r(m:)=sqrt(y0^2+((x0-(m-1)*d))^2);
SMp(m:)=A*exp(-j*(w*t/fs+k*r(m:)))+randn(size(t))/3;
SMx(m:)=A*exp(-j*(w*t/fs+k*r(m:))).*cos(theta2(m:))+randn(size(t))/3;
SMy(m:)=A*exp(-j*(w*t/fs+k*r(m:))).*sin(theta2(m:))+randn(size(t))/3;
end
SM=[SMp.‘SMx.‘SMy.‘];
RM=cov(SM);
x=-30:0.5:30;
y=-30:0.5:30;
for xx=1:length(x)
hwait=waitbar(0‘请等待>>>>>>>>‘);
step=length(x)/100;
if length(x)-xx<=5
waitbar(xx/length(x)hwait‘即将完成‘);
pause(0.1);
else
PerStr=fix(xx/step);
str=[‘正在运行中‘num2str(PerStr)‘%‘];
waitbar(xx/length(x)hwaitstr);
pause(0.1);
end
close(hwait);
for yy=1:length(y)
for m=1:M
theta3=atan(y(yy)/(x(xx)-(m-1)*d));
r2=sqrt(y(yy)^2+((x(xx)-(m-1)*d))^2);
WMp(m)=exp(-j*k*r2);
WMx(m)=exp(-j*k*r2)*cos(theta3);
WMy(m)=exp(-j*k*r2)*sin(theta3);
end
WM=[WMpWMxWMy];
PP(xxyy)=WM*RM*WM‘;
PPm(xxyy)=1/(WM*(RM^-1)*WM‘);
end
end
size(xx)
size(yy)
size(PP)
figure
imagesc(xyabs(PP‘))
colorbar;
colormap gray;
title(‘近场 常规算法波束形成‘)
xlabel(‘x/米‘);
ylabel(‘y/米‘);
axis xy;
figure
imagesc(xyabs(PPm‘))
title(‘近场 MVDR算法波束形成‘)
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3253 2014-07-25 12:26 vectorbeamforing.m
----------- --------- ---------- ----- ----
3253 1
评论
共有 条评论