Add Radar simulation

This commit is contained in:
Ksyer
2024-01-27 20:58:23 +08:00
parent c2e23b4fbf
commit ec0f95c639
12 changed files with 336 additions and 0 deletions
+49
View File
@@ -0,0 +1,49 @@
function s_R = get_reflect_pulse(s_T)
config_parameters;
s_R = complex(zeros(1, len));
real_s_R = zeros(1, len);
imag_s_R = zeros(1, len);
for t_idx = 1:len
t = range_t(t_idx);
p = rem(t, T_r);
if (p > T_p)
continue
end
n = (t - p) / T_r;
t_diff = 2 * (r_0 + velocity * n * T_r) / c;
new_t_idx = floor((t + t_diff) / delta_t);
if new_t_idx > len
continue;
end
s_R(new_t_idx) = scatter_coef * s_T(t_idx);
end
real_s_R = real(s_R);
imag_s_R = imag(s_R);
if figure_flag_2
figure(2)
title("Received signal")
subplot(2, 1, 1);
plot(range_t, imag_s_R);
xlabel("Time (s)");
ylabel("sin(\omega t)");
ylim([-1, 1]);
subplot(2, 1, 2);
plot(range_t, real_s_R);
xlabel("Time (s)");
ylabel("cos(\omega t)");
ylim([-1, 1]);
end
end