%% 频域互相关法测速
clc; clear all; close all;
%% 参数设置
%载波1频率
Fc = 24e9;
%光速
c = 3e8;
%波长
lamda = c/Fc;
%单个周期内调频次数
Nstep = 1024;
%频率调制间隔
delta_F = 1e6;
%单个频率调制时间
Tr = 10e-6;
%% 目标参数设置
R = 100;
vel = 0.1;
%% 速度估计范围
Vmin = -c/( 2*Nstep*Tr*( 2*Fc + ( Nstep - 1 )*delta_F ) );
Vmax = c/( 2*Nstep*Tr*( 2*Fc + ( Nstep - 1 )*delta_F ) );
disp( '最大测量速度:');
disp( Vmin );
disp('最大测量速度: ');
disp( Vmax );
%% 前后相邻脉冲组回波信号生成
% 相位生成
i = 0 : 1 : Nstep - 1;
N = Nstep*ones(1,Nstep);
fi = Fc + i*delta_F;
phi1 = -( ( 4*pi/c )*fi ).*( R - i*vel*Tr );
phi2 = -( ( 4*pi/c )*fi ).*( R - ( N + i )*vel*Tr );
S1 = exp( 1j*phi1 );
S2 = exp( 1j*phi2 );
Max_SNR = 50; % 最大信噪比
Min_SNR = -20;
step = 2;
SNR = Min_SNR:step:Max_SNR;
nums_SNR = length(SNR);
CNT = 1000; % 蒙特卡洛试验次数
vel1 = zeros( nums_SNR, CNT );
j = 1;
for snr = Min_SNR: step : Max_SNR
for n = 1 : CNT
Sig1 = awgn( S1,snr );
Sig2 = awgn( S2,snr );
P1 = angle( Sig1 );
P2 = angle( Sig2 );
R0 = sum( conj( exp( 1j* P1 )).*exp( 1j*P2 ) );
arg_R0 = angle( R0 );
v_est = arg_R0*c/( 2*pi*Nstep*Tr*( 2*Fc + ( Nstep - 1)*delta_F ) );
vel1( j, n ) = v_est;
end
j = j + 1;
end
vel_std = std( vel1 ,0, 2 );
figure
subplot(121);
plot( SNR, vel_std,'^-r' ,'linewidth',2);
xlabel( '信噪比/dB ');
ylabel( ' 速度估计标准差 ' );
title( ' 不同信噪比下的速度估计标准差 ' );
grid on
set( gca,'GridLineStyle','--','GridColor','k','GridAlpha',1 );
speed_step = 0.01;
max_speed = 0.2;
CNT = 1000;
speed = 0 : speed_step : max_speed;
nums_speed = length( speed );
vel2 = zeros( nums_speed,CNT );
SNR = 0;
j = 1;
for velo = 0: speed_step : max_speed
for n = 1 : CNT
phi1 = -( ( 4*pi/c )*fi ).*( R - i*velo*Tr );
phi2 = -( ( 4*pi/c )*fi ).*( R - ( N + i )*velo*Tr );
S1 = exp( 1j*phi1 );
S2 = exp( 1j*phi2 );
Sig1 = awgn( S1,SNR );
Sig2 = awgn( S2,SNR );
P1 = angle( Sig1 );
P2 = angle( Sig2 );
R0 = sum( conj( exp( 1j* P1 )).*exp( 1j*P2 ) );
arg_R0 = angle( R0 );
v_est = arg_R0*c/( 2*pi*Nstep*Tr*( 2*Fc + ( Nstep - 1)*delta_F ) );
vel2( j, n ) = v_est;
end
j = j + 1;
end
vel2_std = std( vel2, 0, 2 );
mean_val = mean( vel2, 2 ) - speed';
subplot(122);
plot( speed, mean_val, '-ob','linewidth',2);
xlabel('速度/m/s');
ylabel('估计速度平均误差/m/s');
title('SNR = 0dB 不同速度下的估计平均误差');
grid on
set( gca,'GridLineStyle','--','GridColor','k','GridAlpha',1 );