Add Radar simulation
This commit is contained in:
Executable
+39
@@ -0,0 +1,39 @@
|
||||
%% 超参数
|
||||
global c f_c B T_r N F_s M k lambda
|
||||
index = 1:1:N; %产生点向量
|
||||
IF_mat = zeros(M,N); %存储带有噪声的中频信号
|
||||
t = 0:1/F_s:T_r-1/F_s; %时间向量 确定256个点在一个Tr中的每个时刻
|
||||
t = t - T_r/2; %将fc作为中心频率
|
||||
|
||||
dist = 10; %目标距离雷达50m的距离
|
||||
t_d = 2 * dist / c; %目标距离雷达的延迟
|
||||
velocity = -20; %目标距雷达的相对速度为30m/s
|
||||
f_d = 2 * f_c * velocity / c; %多普勒频移
|
||||
% f_d = 2 * (f_c - B/2) * velocity / c; %多普勒频移
|
||||
scat_coef = 0.8; %回波信号衰减的比例值
|
||||
|
||||
s_T = chirp(t, f_c, t(end), f_c + B);
|
||||
pad = round(t_d * F_s);
|
||||
s_R = [zeros(1, pad), scat_coef * s_T(1: end - pad)];
|
||||
|
||||
for i = 1: M
|
||||
s_T = 1*exp((1i*2*pi)*(f_c*(t+i*T_r)+k/2*t.^2)); %发射信号
|
||||
s_R = scat_coef*exp((1i*2*pi)*((f_c-f_d)*(t-t_d+i*T_r)+k/2*(t-t_d).^2)); %回波信号
|
||||
|
||||
IF = s_T .* conj(s_R);
|
||||
% SNR = 10;
|
||||
% IF_Noise = awgn(IF, SNR, 'measured');
|
||||
IF_Noise = IF;
|
||||
IF_mat(i, :) = IF_Noise;
|
||||
end
|
||||
|
||||
save('Ego_vehicle_ksy.mat','IF_mat');
|
||||
|
||||
% figure;
|
||||
% subplot(211);
|
||||
% plot(t, s_T);
|
||||
% ylim([-1.3, 1.3]);
|
||||
%
|
||||
% subplot(212);
|
||||
% plot(t, s_R);
|
||||
% ylim([-1.3, 1.3]);
|
||||
Reference in New Issue
Block a user