%构造信号源
n=0:1/12/10^8:1200/12/10^8;%范围
f=1.5*10^8;
m1=4; %2个天线阵元数
m2=4;
m=8;
l=5;
p=3; %信号个数
angle1=44;angle2=65;angle3=80; %信号来向
cys=1200; %采样数
x1=10*cos(f*n+pi/6).*exp(i*(f*n+pi/6)); %构造三个余弦信号
x2=10*cos(1.5*f*n+pi/6).*exp(i*(f*n+pi/6));
x3=10*cos(3*f*n+pi/6).*exp(i*(f*n+pi/6));
%save shy3 x1 x2 x3 %保存信号源
%天线阵元及接收信号
%clear
%close all
i=sqrt(-1); %复数单位
j=i;
angle=[angle1;angle2;angle3];
SN=-3;
degrad=pi/180; %将角度制化为弧度制
%信号和噪声
%load shy3 %载入信号源
TT=1:cys; %采样数矩阵
S=[x1(TT);x2(TT);x3(TT)];
nr1=randn(m1,cys); %建立高斯随机序列
ni1=randn(m1,cys);
K1=nr1+ni1*j; %建立高斯噪声
nr2=randn(m2,cys); %建立高斯随机序列
ni2=randn(m2,cys);
K2=nr2+ni2*j;
%计算协方差矩阵,特征值分解
tmp=j*pi*sin(angle'.*degrad); %相位差
tmp1=[0:m1-1]'; %信号到达阵元的相位差组成的向量
A=tmp1*tmp;
A1=exp(A); %m*p维方向矩阵
X1=A1*S+(0.1)*K1; %第k个阵元上的接收信号
tmp2=i*pi*l*sin(angle'.*degrad);
B1=diag(exp(tmp2));
X2=A1*B1*S+(0.1)*K2;
X=[X1;X2];
Rxx=X*(X)'./(cys^2); %接收信号的协方差
[E,D,V]=svd(Rxx); %计算特征值
Vs=E(:,1:p);
Vu=E(:,p+1:m);
Vs1=E(1:m1,1:p);
Vs2=E(m1+1:m,1:p);
for n=1:p
W(:,n)=Vs1\Vs2(:,n);
end
[I,J]=eig(W);
%这是最初的相位角
K=log(J);
Z=zeros(1,3);
O=[i*4*pi i*4*pi i*4*pi];
F=K+diag(O);
for n=1:3
%Z(1,n)=Asind(((F(n,n)))/(l*pi))
Z(1,n)=asind(imag(F(n,n))/(pi*l))
end
- 1
- 2
- 3
前往页