Initial Commit.
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
clear all
|
||||
close all
|
||||
clc
|
||||
|
||||
c0 = physconst('LightSpeed');
|
||||
fc = 76.5e9;
|
||||
lambda_c = c0 / fc;
|
||||
k_c = 2 * pi / lambda_c;
|
||||
|
||||
num_tgt = 2;
|
||||
|
||||
Ntar_sample = 300;
|
||||
tar_loc_x = linspace(-2.5, 2.5, num_tgt);
|
||||
tar_loc_y = linspace(18, 350, Ntar_sample);
|
||||
tar_loc_z = zeros(1, num_tgt);
|
||||
|
||||
for tidx = 1 : num_tgt
|
||||
tar_xyz(:,:,tidx) = [tar_loc_x(tidx)*ones(Ntar_sample,1) tar_loc_y' tar_loc_z(tidx)*ones(Ntar_sample,1)];
|
||||
[azimuth, elevation, r] = cart2sph(tar_xyz(:,1,tidx), tar_xyz(:,2,tidx), tar_xyz(:,3,tidx));
|
||||
tar_scs(:,:,tidx) = [rad2deg(pi/2 - azimuth) rad2deg(elevation) r];
|
||||
end
|
||||
|
||||
Pt = 13; % [dBm]
|
||||
Pt = Pt - 30; % [dBW]
|
||||
NF = 12; % [dB]
|
||||
T0 = 300; % [K]
|
||||
kb = physconst('Boltzmann');
|
||||
BW_int = 40e6; % [Hz] instantaneous Bandwidth
|
||||
|
||||
% Target RCS
|
||||
rcs = 10; % [dBsm]
|
||||
|
||||
% Noise & Quantization error power
|
||||
%[~, Qnf] = quanttemp(T0, 12, 'DynamicRange', 52); % ADC bit : 12 [bits], Dynamic Range : 52 [dB] (NXP chip)
|
||||
%Qnf = 0;
|
||||
N_bits = 12;
|
||||
Qnf = -1 * (6.02*N_bits + 10*log10(BW_int) + 1.76) - 30;
|
||||
Pnq = pow2db(kb * T0) + NF + Qnf + pow2db(BW_int); % [dBW]
|
||||
|
||||
% Antenna patter loading
|
||||
load('azi_ant_pat.mat');
|
||||
% azi_ant_pat(:,2) = azi_ant_pat(:,2) -16.3 + 15;
|
||||
load('elev_ant_pat.mat');
|
||||
% elev_ant_pat(:,2) = elev_ant_pat(:,2) -16.3 + 15;
|
||||
|
||||
for tidx = 1 : num_tgt
|
||||
tar_ant_gain(:, tidx) = interp1(azi_ant_pat(:,1), azi_ant_pat(:,2), tar_scs(:,1,tidx));
|
||||
tar_elev_ant_gain_reduction = interp1(elev_ant_pat(:,1), elev_ant_pat(:,2), 0) - interp1(elev_ant_pat(:,1), elev_ant_pat(:,2), tar_scs(:,2,tidx));
|
||||
tar_ant_gain(:, tidx) = tar_ant_gain(:,tidx) - tar_elev_ant_gain_reduction;
|
||||
end
|
||||
|
||||
% Losses & SP gains
|
||||
L_sf = 3; % [dB] secondary surface loss
|
||||
L_ant = 2.5; % [dB] Feeder and Radome loss
|
||||
L_win = 2.38 + 1.36; % [dB] loss by windowing in 2D
|
||||
L_straddle = 2.88; % [dB] straddle loss(worst)
|
||||
L_q = 1; % [dB] Quantization loss
|
||||
L_sp = 1; % [dB] Other signal processing losses
|
||||
L_total = L_sf + L_ant + L_win + L_straddle + L_q + L_sp;
|
||||
|
||||
NFFT_R = 512;
|
||||
NFFT_D = 256;
|
||||
G_sp = pow2db(NFFT_R * NFFT_D); % [dB] Signal processing gain by 2D-FFT
|
||||
|
||||
% SNR calculation
|
||||
for tidx = 1 : num_tgt
|
||||
SNR_set(:,tidx) = Pt + pow2db((lambda_c^2) / (4*pi)^3) + pow2db(1./tar_scs(:,3,tidx).^4) + tar_ant_gain(:,tidx) + tar_ant_gain(:,tidx) + rcs - L_total + G_sp - Pnq;
|
||||
end
|
||||
Binary file not shown.
@@ -0,0 +1,11 @@
|
||||
function [rng] = beat2rng(f_beat, f_slope, c0)
|
||||
|
||||
% Objective : Converting beat frequency [Hz] to range [m]
|
||||
|
||||
if isempty(c0)
|
||||
c0 = physconst('LightSpeed');
|
||||
end
|
||||
|
||||
rng = c0 * f_beat / f_slope / 2;
|
||||
|
||||
end
|
||||
@@ -0,0 +1,11 @@
|
||||
function [rng_sep] = bw2rngsep(TxBw, rb, c0)
|
||||
|
||||
% Objective : Converting range resolution to required 3-dB bandwidth needed to distinguish two targets separated by the range specified in r [m]
|
||||
|
||||
if isempty(c0)
|
||||
c0 = physconst('LightSpeed');
|
||||
end
|
||||
|
||||
rng_sep = (c0 * rb) ./ (2*TxBw);
|
||||
|
||||
end
|
||||
@@ -0,0 +1,38 @@
|
||||
function [total_nf, total_gain, total_temp] = cal_nf(nf_set, gain_set, reftemp)
|
||||
|
||||
% Check inputs
|
||||
narginchk(2,3);
|
||||
|
||||
% Validate
|
||||
validateattributes(nf_set,{'double'}, {'nonnan','nonempty','real', ...
|
||||
'vector','nonnegative'}, 'noisefigure', 'NF');
|
||||
numNF = numel(nf_set);
|
||||
validateattributes(gain_set,{'double'}, {'nonnan','nonempty','real', ...
|
||||
'vector','numel',numNF}, 'noisefigure', 'G');
|
||||
NFcol = db2pow(nf_set(:));
|
||||
Gcol = db2pow(gain_set(:));
|
||||
|
||||
% Check for temperature input
|
||||
if nargin < 3
|
||||
reftemp = 290; % Standard noise temperature (Kelvin)
|
||||
else
|
||||
validateattributes(reftemp,{'double'}, {'finite','nonempty','real', ...
|
||||
'nonnegative','scalar'}, 'noisefigure', 'REFTEMP');
|
||||
end
|
||||
|
||||
% Calculate total gain
|
||||
total_gain = sum(gain_set(:),1); % dB
|
||||
|
||||
% Calculate cascaded noise figure
|
||||
if numel(NFcol) > 1
|
||||
cnfLinear = NFcol(1) + sum((NFcol(2:end) - 1)./cumprod(Gcol(1:end-1),1),1); % Linear
|
||||
total_nf = 10*log10(cnfLinear); % dB
|
||||
else
|
||||
cnfLinear = NFcol(1);
|
||||
total_nf = nf(1);
|
||||
end
|
||||
|
||||
% Calculate cascaded noise temperature
|
||||
total_temp = reftemp*(cnfLinear); % Kelvin
|
||||
|
||||
end
|
||||
@@ -0,0 +1,11 @@
|
||||
function [deltaR] = cal_rdcoupling(dop, f_slope, c0)
|
||||
|
||||
% Objective : Calculating range offset [m] due to Doppler shift [Hz] in a LFM signal
|
||||
|
||||
if isempty(c0)
|
||||
c0 = physconst('LightSpeed');
|
||||
end
|
||||
|
||||
deltaR = -c0 * dop / (2 * f_slope);
|
||||
|
||||
end
|
||||
@@ -0,0 +1,7 @@
|
||||
function [deltaR] = cal_rtmcoupling(spd, PRI, m)
|
||||
|
||||
% Objective : Calculating range offset [m] due to Target Motion during sweeps in a LFM signal
|
||||
|
||||
deltaR = -m * PRI * spd;
|
||||
|
||||
end
|
||||
@@ -0,0 +1,10 @@
|
||||
function [sig_out] = dechirping(sig_in, sig_ref)
|
||||
|
||||
% Objecrtive : Mixing the incoming signal, sig_in, with the reference
|
||||
% signal, sig_ref.
|
||||
|
||||
sig_ref = cast(sig_ref, class(sig_in));
|
||||
|
||||
sig_out = bsxfun(@times, conj(sig_ref), sig_in);
|
||||
|
||||
end
|
||||
@@ -0,0 +1,7 @@
|
||||
function [spd] = dop2spd(dop, lambda)
|
||||
|
||||
% Objective : Converting Doppler shift [Hz] to Radial Speed [m/s] for one-way propagation
|
||||
|
||||
spd = dop * lambda;
|
||||
|
||||
end
|
||||
Binary file not shown.
@@ -0,0 +1,68 @@
|
||||
function [waveform_seq] = gen_fastramp_fmcw(timing_struct, fs, f0, TxBw, NumChirps, prop_delay, phase_initial, opt)
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%
|
||||
% Generating Fast Ramp Linear FMCW waveform
|
||||
% Start : 23.12.22
|
||||
% End : xx.xx.xx
|
||||
% developed by Kwanggoo Yeo
|
||||
%
|
||||
% Description
|
||||
% - Input
|
||||
% - 1) timing_struct [struct], [-] : Timing information for one chirp
|
||||
% - 1-1) T_dwell [scalar], [sec] : Time length for idle
|
||||
% - 1-2) T_settle [scalar], [sec] : Time length for ramp start but not acquisition
|
||||
% - 1-3) T_jumpback [scalar], [sec] : Time length for go back to the start frequency
|
||||
% - 1-4) T_reset [scalar], [sec] : Time length for reset
|
||||
% - 1-5) T_acq [scalar], [sec] : Time length for acqusition
|
||||
% - 2) fs [scalar], [Hz] : Sampling rate
|
||||
% - 3) f0 [scalar], [Hz] : Start frequency
|
||||
% - 4) TxBw [scalar], [Hz] : Waveform Bandwidth
|
||||
% - 5) NumChirps [scalar], [-] : The number of chirps in one frame
|
||||
% - 6) prop_delay [scalar], [sec] : Time delay by range between radar and target
|
||||
% - 7) phase_ini [scalar], [deg] : Initial phase of Tx waveform in deg
|
||||
%
|
||||
% - Output
|
||||
% - 1) waveform_seq [struct], [-] : Struct containing waveform information
|
||||
% - 1-1) T_chirp [scalar], [sec] : Time length for one chirp
|
||||
% - 1-2) T_frame [scalar], [sec] : Time length for one frame
|
||||
% - 1-3) timeline [vec], [sec] : Time index for Fast ramp Linear FMCW sequence
|
||||
% - 1-4) waveform [matrix], [-] : Fast ramp Linear FMCW sequence
|
||||
%
|
||||
% History
|
||||
% (23.12.22) Start
|
||||
%
|
||||
% Referece
|
||||
% -
|
||||
%
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
T_dwell = timing_struct.T_dwell;
|
||||
T_settle = timing_struct.T_settle;
|
||||
T_acq = timing_struct.T_acq;
|
||||
T_jumpback = timing_struct.T_jumpback;
|
||||
T_reset = timing_struct.T_reset;
|
||||
T_idle = timing_struct.T_idle;
|
||||
|
||||
waveform_seq.T_chirp = T_dwell + T_settle + T_acq + T_jumpback + T_reset + T_idle;
|
||||
|
||||
waveform_seq.T_frame = waveform_seq.T_chirp * NumChirps;
|
||||
|
||||
waveform_seq.f_slope = TxBw / T_acq;
|
||||
|
||||
waveform_seq.timeline = (0 : 1/fs : (T_acq - 1/fs)) + T_dwell + T_settle + prop_delay;
|
||||
|
||||
if opt == 0
|
||||
waveform_seq.waveform = cos(2 * pi * f0 * waveform_seq.timeline + 2 * pi * (waveform_seq.f_slope/2 * waveform_seq.timeline.^2) + phase_initial);
|
||||
waveform_seq.waveform = waveform_seq.waveform / sqrt(norm(waveform_seq.waveform)^2 / length(waveform_seq.waveform));
|
||||
elseif opt == 1
|
||||
waveform_seq.waveform = exp(1i * 2 * pi * f0 * waveform_seq.timeline + 1i * 2 * pi * (waveform_seq.f_slope/2 * waveform_seq.timeline.^2) + 1i* phase_initial);
|
||||
waveform_seq.waveform = waveform_seq.waveform / sqrt(norm(waveform_seq.waveform)^2 / length(waveform_seq.waveform));
|
||||
else
|
||||
disp('Opt error! : Real waveform(opt = 0) or Complex waveform(opt = 1)')
|
||||
return;
|
||||
end
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
function [waveform_seq] = gen_fastramp_fmcw2(timing_struct, fs, f0, TxBw, ChirpIndex, NumChirps, prop_delay, phase_initial, opt)
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%
|
||||
% Generating m-th Fast Ramp Linear FMCW waveform with considering different PRI
|
||||
% Start : 23.12.22
|
||||
% End : xx.xx.xx
|
||||
% developed by Kwanggoo Yeo
|
||||
%
|
||||
% Description
|
||||
% - Input
|
||||
% - 1) timing_struct [struct], [-] : Timing information for one chirp
|
||||
% - 1-1) T_dwell [scalar], [sec] : Time length for idle
|
||||
% - 1-2) T_settle [scalar], [sec] : Time length for ramp start but not acquisition
|
||||
% - 1-3) T_jumpback [scalar], [sec] : Time length for go back to the start frequency
|
||||
% - 1-4) T_reset [scalar], [sec] : Time length for reset
|
||||
% - 1-5) T_acq [scalar], [sec] : Time length for acqusition
|
||||
% - 2) fs [scalar], [Hz] : Sampling rate
|
||||
% - 3) f0 [scalar], [Hz] : Start frequency
|
||||
% - 4) TxBw [scalar], [Hz] : Waveform Bandwidth
|
||||
% - 5) ChirpIndex [scalar], [-] : m-th chirp index ( m= 1, 2, 3, ..., M )
|
||||
% - 6) NumChirps [scalar], [-] : The number of chirps in one frame
|
||||
% - 7) prop_delay [scalar], [sec] : Time delay by range between radar and target
|
||||
% - 8) phase_ini [scalar], [deg] : Initial phase of Tx waveform in deg
|
||||
%
|
||||
% - Output
|
||||
% - 1) waveform_seq [struct], [-] : Struct containing waveform information
|
||||
% - 1-1) T_chirp [scalar], [sec] : Time length for one chirp
|
||||
% - 1-2) T_frame [scalar], [sec] : Time length for one frame
|
||||
% - 1-3) timeline [vec], [sec] : Time index for Fast ramp Linear FMCW sequence
|
||||
% - 1-4) waveform [matrix], [-] : Fast ramp Linear FMCW sequence
|
||||
%
|
||||
% History
|
||||
% (23.12.22) Start
|
||||
%
|
||||
% Referece
|
||||
% -
|
||||
%
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
T_dwell = timing_struct.T_dwell;
|
||||
T_settle = timing_struct.T_settle;
|
||||
T_acq = timing_struct.T_acq;
|
||||
T_jumpback = timing_struct.T_jumpback;
|
||||
T_reset = timing_struct.T_reset;
|
||||
T_idle = timing_struct.T_idle;
|
||||
|
||||
waveform_seq.T_chirp = T_dwell + T_settle + T_acq + T_jumpback + T_reset + T_idle;
|
||||
|
||||
waveform_seq.T_frame = waveform_seq.T_chirp * NumChirps;
|
||||
|
||||
waveform_seq.f_slope = TxBw / T_acq;
|
||||
|
||||
waveform_seq.timeline = T_dwell + T_settle + (0 : 1/fs : (T_acq - 1/fs)) + ((ChirpIndex-1) * waveform_seq.T_chirp) + prop_delay;
|
||||
|
||||
|
||||
|
||||
if opt == 0
|
||||
waveform_seq.waveform = cos(2 * pi * f0 * waveform_seq.timeline + 2 * pi * (waveform_seq.f_slope/2 * waveform_seq.timeline.^2) + phase_initial);
|
||||
waveform_seq.waveform = waveform_seq.waveform / sqrt(norm(waveform_seq.waveform)^2 / length(waveform_seq.waveform));
|
||||
elseif opt == 1
|
||||
waveform_seq.waveform = exp(1i * 2 * pi * f0 * waveform_seq.timeline + 1i * 2 * pi * (waveform_seq.f_slope/2 * waveform_seq.timeline.^2) + 1i* phase_initial);
|
||||
waveform_seq.waveform = waveform_seq.waveform / sqrt(norm(waveform_seq.waveform)^2 / length(waveform_seq.waveform));
|
||||
else
|
||||
disp('Opt error! : Real waveform(opt = 0) or Complex waveform(opt = 1)')
|
||||
return;
|
||||
end
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
function [f_beat] = rng2beat(rng, f_slope, c0)
|
||||
|
||||
% Objective : Converting the range [m] of a dechirped linear FMCW signal to
|
||||
% its corresponding range, beat frequency [Hz]
|
||||
%
|
||||
% f_beat = (2 * f_slope * rng) / c0
|
||||
%
|
||||
|
||||
if isempty(c0)
|
||||
c0 = physconst('LightSpeed');
|
||||
end
|
||||
|
||||
f_beat = 2 * rng / c0 * f_slope;
|
||||
|
||||
end
|
||||
@@ -0,0 +1,11 @@
|
||||
function [t] = rng2time(r, c0)
|
||||
|
||||
% Objective : Calculating the time that a signal takes to propagate given range, r
|
||||
|
||||
if isempty(c0)
|
||||
c0 = physconst('LightSpeed');
|
||||
end
|
||||
|
||||
t = r / c0;
|
||||
|
||||
end
|
||||
@@ -0,0 +1,11 @@
|
||||
function [req_bw] = rngres2bw(rng_res, rb, c0)
|
||||
|
||||
% Objective : Converting range resolution to required 3-dB bandwidth needed to distinguish two targets separated by the range specified in r [m]
|
||||
|
||||
if isempty(c0)
|
||||
c0 = physconst('LightSpeed');
|
||||
end
|
||||
|
||||
req_bw = (c0 * rb) ./ (2*rng_res);
|
||||
|
||||
end
|
||||
@@ -0,0 +1,7 @@
|
||||
function [dop] = spd2dop(spd, lambda)
|
||||
|
||||
% Objective : Converting the speed [m/s] to the corresponding Doppler frequency shift [Hz] for one-way propagation
|
||||
|
||||
dop = spd / lambda;
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user