%%该程序仿真利用干涉技术测向的方法,测试不同分数比的影响
clear all;
close all;
clc;
result=zeros(1,100);
for Loop=1:500
for loop=1:100
d1=0.58;%%
d2=(loop+0.0015)*d1;%%可以调整分数比
k=floor(d2/d1);%%基线的整数倍
deltak=d2/d1-k;%%基线的小数部分
f=1e10;%%信号频率
C=3e8;%光速
lambda=C/f;%信号波长
sita0=30;%%入射角
sita=((sita0)/180)*pi;
phi1=2*pi*d1*sin(sita)/lambda;
phi2=2*pi*d2*sin(sita)/lambda;
delta_phi10=mod(phi1,2*pi);
delta_phi20=mod(phi2,2*pi);
sig1=exp(j*phi1)+0.0001*(randn(1)+j*randn(1));
sig2=exp(j*phi2)+0.0001*(randn(1)+j*randn(1));
delta_phi1=mod(angle(sig1),2*pi);
delta_phi2=mod(angle(sig2),2*pi);
c=floor(delta_phi1*(d2/d1)/(2*pi));
% m=n*k+c;
phi=delta_phi2+2*pi*c-delta_phi1*(d2/d1);
if abs(phi)<=1e-5
phi=0;
end
if phi>=0
n=floor((phi/(2*pi*deltak)+0.5));
m=n*k+c;
else
n=floor((phi+2*pi)/(2*pi*deltak)+0.5);
m=n*k+c+1;
end
temp1(loop)=n*deltak;
answer1(loop)=abs(asin((2*pi*n+delta_phi1)*lambda/(2*pi*d1))/(2*pi)*360);%利用phi1求解
answer2(loop)=abs(asin((2*pi*m+delta_phi2)*lambda/(2*pi*d2))/(2*pi)*360);%利用phi2求解
delta_phi=1/2*(delta_phi2+(2*pi*n+delta_phi1)*d2/d1-2*pi*m);%最小二乘解
answer(loop)=abs(asin((2*pi*m+delta_phi)*lambda/(2*pi*d2))/(2*pi)*360);
end
result=result+(answer-sita0).^2;
Loop
end
result=(result/Loop).^0.5;
figure;plot((10:10:100),result(10:10:100),':*')
xlabel('不同分数比');
ylabel('测量误差');