自适应波束形成与Matlab程序代码注解.docx
《自适应波束形成与Matlab程序代码注解.docx》由会员分享,可在线阅读,更多相关《自适应波束形成与Matlab程序代码注解.docx(20页珍藏版)》请在冰点文库上搜索。
自适应波束形成与Matlab程序代码注解
1.均匀线阵方向图
〔1matlab程序
clc;
clearall;
closeall;
imag=sqrt<-1>;
element_num=32;%阵元数为8
d_lamda=1/2;%阵元间距d与波长lamda的关系
theta=linspace<-pi/2,pi/2,200>;
theta0=0;%来波方向
w=exp*[0:
element_num-1]'>;
forj=1:
length
a=exp>*[0:
element_num-1]'>;
p=w'*a;
end
patternmag=abs
;
patternmagnorm=patternmag/max>;
patterndB=20*log10;
patterndBnorm=20*log10;
figure<1>
plot;
gridon;
xlabel<'theta/radian'>
ylabel<'amplitude/dB'>
title<[num2str'阵元均匀线阵方向图','来波方向为'num2str'度']>;
holdon;
figure<2>
plot;
gridon;
xlabel<'theta/radian'>
ylabel<'amplitude/dB'>
title<[num2str'阵元均匀线阵方向图','来波方向为'num2str'度']>;
axis<[-1.51.5-500]>;
(2)仿真结果
A.来波方向为0°
不归一化
归一化
B.来波方向为45°
不归一化
归一化
C.随着阵元数的增加,波束宽度变窄,分辨力提高,仿真图如下:
非归一化
归一化
不归一化
归一化
2.波束宽度与波达方向及阵元数的关系
〔1matlab程序
clc;
clearall;
closeall;
imag=sqrt<-1>;
element_num1=16;
element_num2=128;
element_num3=1024;
lambda=0.1;
d=0.5*lambda;
theta=0:
0.5:
90;
forj=1:
length
fai=theta*pi/180-asin*pi/180>-lambda/>;
psi=theta*pi/180-asin*pi/180>-lambda/>;
beta=theta*pi/180-asin*pi/180>-lambda/>;
end
figure
plot;
gridon;
xlabel<'theta'>;
ylabel<'widthinradians'>;
title<'波束宽度与达波方向及阵元数目的关系'>;
legend<'N=16','N=128','N=1024'>;
(2)仿真结果
结果
3.当阵元间距
时,会出现栅瓣,导致空间模糊
〔1仿真结果
非归一化
归一化
4.类似于时域滤波,天线方向图是最优权的傅立叶变换
〔1matlab程序
clc;
clearall;
closeall;
imag=sqrt<-1>;
element_num=32;
source_num=1;
d_lambda=0.5;
theta=linspace<-pi/2,pi/2,200>;
theta0=0;
w=exp*[0:
element_num-1]'>;
forj=1:
length
a=exp>*[0:
element_num-1]'>;
p=w'*a;
end
patternmag=abs
;
patternmagnorm=patternmag/max>;
patterndB=20*log10;
patterndBnorm=20*log10;
figure<1>
subplot<1,2,1>;
plot;
gridon;
xlabel<'theta/radian'>;
ylabel<'amplitude/dB'>;
axis<[-2.02.0-500]>;
subplot<1,2,2>;
pfft=fftshift>;
pfftmag=abs;
pfftmagnorm=pfftmag/max>;
pfftdB=20*log10;
pfftdBnorm=20*log10;
plot,pfftdBnorm>;
gridon;
xlabel<'theta/radian'>;
ylabel<'FFT_amplitude/dB'>;
axis<[-2.02.0-500]>;
〔2仿真结果
5.最大信噪比准则方向图和功率谱
(1)matlab程序
clc;
clearall;
closeall;
imag=sqrt<-1>;
element_num=8;%阵元数为8
d_lambda=0.5;%间距为半波长
theta=-90:
0.5:
90;%扫描范围
theta0=0;%来波方位
theta1=20;%干扰方向
L=512;%采样点数
fori=1:
L
amp0=10*randn<1>;
amp1=200*randn<1>;
ampn=1;s<:
i>=amp0*exp*[0:
element_num-1]'>;j<:
i>=amp1*exp*[0:
element_num-1]'>;n<:
i>=ampn*exp+imag*randn>;
end
Rs=1/L*s*s';%信号自相关矩阵
Rnj=1/L*;%干扰+噪声的自相关矩阵
[V,D]=eig;%〔Rs,Rnj的广义特征值和特征向量
[D,I]=sort>;%特征向量排序
Wopt=V<:
I<8>>;%最优权矢量
forj=1:
length
a=exp*pi/180>*[0:
element_num-1]'>;
f=Wopt'*a;
p=a'*Rs*a+a'*Rnj*a;
end
F=20*log10/max>>>;
P=20*log10/max>>>;
subplot<1,2,1>
plot;
gridon;
holdon;
plot0,'.'>;
plot0,'.'>;
xlabel<'theta/0'>;
ylabel<'FindB'>;
title<'max-SNR方向图'>;
axis<[-9090-800]>;
holdon;
subplot<1,2,2>;
plot;
gridon;
xlabel<'theta/0'>;
ylabel<'功率indB'>;
title<'max-SNR功率谱'>;
gridon;
axis<[-9090-800]>;
〔2仿真结果
6.ASC旁瓣相消----MSE准则
<1>matlab程序
clc;
closeall;
clearall;
imag=sqrt<-1>;
M=32;%辅助天线数目
d_lambda=0.5;%阵元间距
theta0=-30;%来波方向
theta1=60;%干扰方向
L=512;%采样单元数
s=zeros<1,512>;%预划分一个区域
forii=1:
L
amp0=1*randn<1>;%信号的幅度随机产生,保证信号之间是不相关的
amp1=200*randn<1>;
ampn=1;
jam<:
ii>=amp1*exp*[0:
M-1]'>+ampn*+imag*randn>;%干扰+噪声
s=amp0*exp>+amp1*exp>+ampn*+imag*randn<1,1>>;%接收信号〔信号+干扰+噪声
s0=amp0*exp>;
end
Rx=1/L*jam*jam';
r_xd=1/L*jam*s';
Wopt=pinv*r_xd;
delta=s0-;
delta1=abs->.^2>;
theta=linspace<-pi/2,pi/2,200>;
forjj=1:
length
a=exp>*[0:
M-1]'>;
f=Wopt'*a;
end
F=20*log10/max>>>;
figure<1>
plot;
gridon;
holdon;
plot0,'.'>;
plot0,'.'>;
xlabel<'theta/°'>;
ylabel<'F/dB'>;
title<'MSE准则下的方向图'>;
axis<[-9090-500]>;
〔2仿真结果
7.线性约束最小方差准则
(1)matlab程序
clc;
clearall;
closeall;
imag=sqrt<-1>;
element_num=8;%阵元数
d_lambda=0.5;%阵元间距与波长的关系
theta=-90:
0.5:
90;%搜索范围
theta0=0;%三个信号源的来波方向
theta1=30;
theta2=60;
L=512;%采样单元数
fori=1:
L
amp0=10*randn<1>;
amp1=100*randn<1>;
amp2=10*randn<1>;
ampn=10;
x<:
i>=amp0*exp*[0:
element_num-1]'>+amp1*exp*[0:
element_num-1]'>+amp2*exp*[0:
element_num-1]'>+ampn*+imag*randn>;
end
Rx=1/L*x*x';
steer1=exp*[0:
element_num-1]'>;
steer2=exp*[0:
element_num-1]'>;
steer3=exp*[0:
element_num-1]'>;
C=[steer1steer2steer3];
F=[101]';%把三个方向都作为来波方向
w=inv*C**C>>*F;
forj=1:
length
a=exp*pi/180>*[0:
element_num-1]'>;
f=w'*a;
p=1/*a>;
end
F=20*log10/>>>>;
subplot<1,2,1>
plot;
gridon;
holdon;
plot0,'.'>;
plot0,'.'>;
plot0,'.'>;
xlabel<'theta/°'>;
ylabel<'F/dB'>;
title<'Caponbeamforming方向图'>;
axis<[-9090-200]>;
P=20*log10/>>>>;
subplot<1,2,2>
plot;
gridon;
holdon;
plot0,'.'>;
plot0,'.'>;
plot0,'.'>;
xlabel<'theta/°'>;
ylabel<'P/dB'>;
title<'Caponbeamforming功率谱'>;
axis<[-9090-200]>;
(2)仿真结果
8.Caponbeamforming
(1)matlab程序
clc;
clearall;
closeall;
imag=sqrt<-1>;
element_num=8;%阵元数
d_lambda=0.5;%阵元间距与波长的关系
theta=-90:
0.5:
90;%搜索范围
theta0=0;%三个信号源的来波方向
theta1=20;
theta2=60;
L=1000;%采样单元数
fori=1:
L
amp0=10*randn<1>;
amp1=200*randn<1>;
amp2=200*randn<1>;
ampn=3;x<:
i>=amp0*exp*[0:
element_num-1]'>+amp1*exp*[0:
element_num-1]'>+amp2*exp*[0:
element_num-1]'>+ampn*+imag*randn>;
end
Rx=1/L*x*x';
R=inv;
steer=exp*[0:
element_num-1]'>;
w=R*steer/;%最优权矢量
forj=1:
length
a=exp*pi/180>*[0:
element_num-1]'>;
f=w'*a;
p=1/;
end
F=20*log10/>>>>;
subplot<1,2,1>
plot;
gridon;
holdon;
plot0,'.'>;
plot0,'.'>;
plot0,'.'>;
xlabel<'theta/°'>;
ylabel<'F/dB'>;
title<'Caponbeamforming方向图'>;
axis<[-9090-500]>;
P=20*log10/>>>>;
subplot<1,2,2>
plot;
gridon;
holdon;
xlabel<'theta/°'>;
ylabel<'P/dB'>;
title<'Caponbeamforming功率谱'>;
axis<[-9090-900]>;
(2)仿真结果
9.不同方法估计协方差矩阵的Capon波束形成
〔1matlab程序
clc;
clearall;
closeall;
imag=sqrt<-1>;
element_num=8;%阵元数为8
d_lambda=0.5;%间距为半波长
theta=-90:
0.5:
90;%扫描范围
theta0=0;%来波方向
theta1=50;%干扰方向
L=1024;%采样单元数
fori=1:
L
amp0=10*randn<1>;
amp1=50*randn<1>;
ampn=0.5;
s<:
i>=amp0*exp*[0:
element_num-1]'>;
j<:
i>=amp1*exp*[0:
element_num-1]'>;
n<:
i>=ampn*exp*[0:
element_num-1]'>;
end
Rx=1/L**';%接收信号自相关矩阵
Rnj=1/L**';%%干拢+噪声的自相关矩阵
e=exp*[0:
element_num-1]'>;
Wopt_Rx=inv*e/*e>;%采用接收信号的权矢量
Wopt_Rnj=inv*e/*e>;%采用干拢+噪声信号的权矢量
forj=1:
length
a=exp*pi/180>*[0:
element_num-1]'>;
f1=Wopt_Rx'*a;
f2=Wopt_Rnj'*a;
end
F1=20*log10/max>>>;
F2=20*log10>>>>;
figure;
plot;
gridon;
holdon;
plot0,'.'>;
plot0,'.'>;
xlabel<'theta/°'>;
ylabel<'F<1,2>/dB'>;
title<'不同方法估计协方差矩阵的Capon波束形成'>;
axis<[-9090-600]>;
〔2仿真结果
10.多点约束的Capon波束形成和方向图
〔1matlab程序
clc;
clearall;
closeall;
imag=sqrt<-1>;
element_num=8;
d_lambda=0.5;
theta=-90:
0.3:
90;
theta0=0;
theta1=20;
theta2=50;
L=512;
Rx=zeros;%产生协方差矩阵
fori=1:
L
amp0=10*randn<1>;
amp1=10*randn<1>;
amp2=50*randn<1>;
ampn=0.5*randn<1>;%噪声的幅度随机产生,保证噪声与信号之间是不相关的
j<:
i>=amp1*exp*[0:
element_num-1]'>+amp2*exp*[0:
element_num-1]'>+ampn*exp*[0:
element_num-1]'>;
x<:
i>=amp0*exp*[0:
element_num-1]'>+j<:
i>;%表示接收信号
end
Rx=1/L*x*x';
R=inv;
w=amp0*exp*[0:
element_num-1]'>+amp1*exp*[0:
element_num-1]'>+amp2*exp*[0:
element_num-1]'>;
forj=1:
length
a=exp*pi/180>*[0:
element_num-1]'>;
f=w'*a;
p=1/;
end
F=20*log10/max>>>;
P=20*log10/max>>>;
figure;
subplot<1,2,1>;
plot;
gridon;
holdon;
plot0,'