%% 雷达参数设置
clear all;
close all;
clc;
c = 3e8;
fc = 24e9; % 中心频率
lamda = c / fc;
Tp = 300e-6; % 发射信号脉宽
BW = 200e6; % LFM信号带宽
Kr = BW/Tp; % 调频率
fs = 213.33e3; % 距离向采样频率
PRF = 1/0.15; % 脉冲重复频率
v_radar = 0.03;
D = 0.05; % 方位向天线尺寸
Rc = 0; % 雷达平台与场景中心距离
N_scatter = 1; % 目标个数
x = [0.3;0]; % 设置目标位置
y = [1.2; 2.4] + Rc;
sigma = [1;1];
scatter = [x, y, sigma]; % 目标信息矩阵:方位,距离,散射强度
R_ref = 0;
L = lamda * Rc / D; % 合成孔径长度
%% 产生回波信号
x1 = -0.5; % 雷达平台起始位置
x2 = 0.5; % 雷达平台结束位置
tm = x1 / v_radar : 1/PRF : x2 / v_radar; % 慢时间(方位向)
Rmin = min(y)-1;
Rmax = sqrt((max(y) )^2 + (L/2)^2) + 100;
t = 0 : 1/fs : 0 + 65/fs; % 快时间(距离向)
% t = 2 * Rmin / c : 1 / fs : 2 * Rmax / c;
Nr = length(t);
Na = length(tm);
fr = linspace(-fs/2, fs/2, Nr); % 距离频率
fa = linspace(-PRF/2, PRF/2, Na); % Doppler频率
s = zeros(Nr, Na);
for i = 1 : length(x)
R = sqrt(scatter(i, 2) .^ 2 + (v_radar * tm - scatter(i, 1)) .^ 2)...
.* (abs(tm .* v_radar - scatter(i, 1)) <= scatter(i, 2) * lamda / D / 2);
dR = -R + R_ref; dt = t' - 2 * R_ref / c;
s = s + sigma(i) * exp(-1i * 4 * pi * fc / c * dR...
- 1i * 4 * pi * Kr / c * bsxfun(@times, dt, dR)...
+ 1i * pi * Kr * 4 / c / c * dR .^ 2) ...
.* (abs(t' - 2 * R ./ c) <= Tp)...
.* (abs(tm .* v_radar - scatter(i, 1)) <= scatter(i, 2) * lamda / D / 2);
end
figure;
imagesc(abs(s));
1;
temp = s(50, :);
temp2 = fftshift(fft(temp));
figure; plot(real(temp));
1;
%% range profile
calib_rx1 = mean(s, 2);
s = s - calib_rx1;
range_profile = fftshift(fft(s, 256, 1), 1);
fr = (0 : 255) * fs / 256;
range = -c * fr / 2 / Kr;
rp = abs(range_profile(:, 100))./ max(abs(range_profile(:, 100)));
figure;
plot(range, 20 * log10(rp)); hold on;
window = hamming(ceil(Tp * fs)); %?????
data_w = s;
data_w(1 : ceil(Tp * fs), :) = bsxfun(@times, s(1 : ceil(Tp * fs), :), window);
range_profile_w = fftshift(fft(data_w, 256, 1), 1);
rp_w = abs(range_profile_w(:, 100)) ./ max(abs(range_profile_w(:, 100)));
plot(range, 20 * log10(rp_w));
axis([-inf inf -35 0]);
%% RD
% range compression
Nr_fft = 64;
f_fft = (-Nr_fft/2 : Nr_fft/2-1) * fs / Nr_fft;
range = c * f_fft / 2 / Kr;
azimuth = linspace(x1, x2, Na);
s_rc = fftshift(fft(s, Nr_fft, 1), 1); % 方位向FFT
figure
imagesc(azimuth, range, abs(s_rc));
title('range compression');
1;
temp = s_rc(:, 100);
temp2 = fftshift(fft(temp));
figure; plot(real(temp)); title('azimuth signal -- LFM')
1;
[m, n] = find(abs(s_rc) == max(max(abs(s_rc))));
% m = 136;
figure; plot(real(s_rc(m(1), :)));
title('azimuth signal after range compression')
1;
% RVP
fr = linspace(-fs/2, fs/2, Nr_fft); % 距离频率
H_RVP = exp(-1i * pi * fr' .^ 2 / Kr);
s_rc = bsxfun(@times, s_rc, H_RVP);
% azimuth FFT
Rc = range';
% Rc = 1.8;
S_tfd = fftshift(fft(s_rc, [], 2), 2);
figure; imagesc(abs(S_tfd)); title('azimuth FFT') % Extend Dopler frequency
figure; plot(real(S_tfd(m(1), :))); title('azimuth signal -- frequency domain')
1;
% azimuth compression--matched filter
Km = -2 * v_radar * v_radar / lamda ./ Rc;
ta = -Na/2/PRF : 1/PRF : (Na/2-1)/PRF;
ta = 0 : 1/PRF : (Na - 1)/PRF;
h2 = exp(1i * pi * bsxfun(@times, Km, ta .^ 2)) ...
.* (abs(ta) <= repmat(Rc * lamda / D / v_radar/1, 1, Na));
H2 = fftshift(fft(h2));
H2 = fftshift(fft(h2, [], 2), 2);
figure;
subplot(2,1,1); plot(real(h2(1, :))); title('azimuth filter-t');
subplot(2,1,2); plot(real(H2(1, :))); title('azimuth filter-f');
1;
% R_ref = 0;
% fa = linspace(-PRF/2, PRF/2, Na); % Doppler频率
% H2 = exp(1i * 2 * pi * (2 * fc * Rc / c - bsxfun(@times, Rc * c, fa .^ 2) / 4 / fc / v_radar / v_radar...
% -fc * 2 * R_ref/c));
% % figure;
% % subplot(2,1,2); plot(real(H2(150, :))); title('azimuth filter-f');
% % h2 = ifft(ifftshift(H2));
% % subplot(2,1,1); plot(real(h2(150, :))); title('azimuth filter-t');
% 1;
% azimuth compression
S_ac = S_tfd .* H2;
figure; imagesc(abs(S_ac)); title('azimuth compression-rd');
s_ac = ifft(ifftshift(S_ac, 2), [], 2);
figure;
subplot(2,1,1); plot(real(S_ac(m(1), :))); title('frequency signal after azimuth compression')
subplot(2,1,2); plot(real(s_ac(m(1), :)));title('time signal after azimuth compression')
1;
% temp1 = S_tfd(51, :) .* H2(51, :);
% s_temp1 = ifft(ifftshift(temp1));
% figure;
% subplot(2,1,1); plot(real(temp1)); title('frequency signal after azimuth compression')
% subplot(2,1,2); plot(real(s_temp1));title('time signal after azimuth compression')
% 1;
figure
imagesc(azimuth, range, abs(s_ac));
title('azimuth compression');
评论0