rdm
Range-Doppler map (RDM) generation and plotting.
Provides the :func:gen entry point that simulates a full CPI — adding skin
and jammer returns to a datacube, applying matched filtering, Doppler
windowing, and the slow-time FFT — and a set of plot helpers for RTMs and RDMs.
gen(radar, waveform, return_list, seed=0, plot=True, debug=False, window='chebyshev', window_kwargs=None)
Generate a Range-Doppler Map (RDM) for a single Coherent Processing Interval (CPI).
Simulates received radar data for one or more targets moving at constant range rates and processes it to produce an RDM, accounting for radar system parameters, waveform characteristics, and noise.
Output amplitudes are in Volts (at the receiver load). To view the RDM
in SNR voltage ratio, pass the returned datacube through :func:to_snr.
To get a noiseless RDM for peak-finding or PSF inspection, set
radar.op_temp = 0 (thermal noise scales with temperature).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
radar
|
Radar
|
Radar system parameters. See
:class: |
required |
waveform
|
WaveformSample
|
WaveformSample created by a factory function
(e.g. :func: |
required |
return_list
|
list
|
List of :class: |
required |
seed
|
int
|
Random number generator seed for reproducibility. Defaults to 0. |
0
|
plot
|
bool
|
If True, plots the final RDM. Defaults to True. |
True
|
debug
|
bool
|
If True, plots intermediate processing steps and prints diagnostic statistics. Defaults to False. |
False
|
window
|
str
|
Doppler window function applied before the slow-time FFT.
One of |
'chebyshev'
|
window_kwargs
|
dict | None
|
Optional dict forwarded to the underlying
|
None
|
Returns:
| Name | Type | Description |
|---|---|---|
tuple |
tuple[ndarray, ndarray, ndarray]
|
|
Source code in src/rad_lab/rdm.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | |
plot_rdm(rdot_axis, r_axis, data, title, cbar_min=-100, volt_to_dbm=True)
Plots a range-Doppler matrix (RDM).
The RDM shows radar data after pulse compression and Doppler processing.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rdot_axis
|
ndarray
|
1D array of range-rate values in m/s. |
required |
r_axis
|
ndarray
|
1D array of range values in meters. |
required |
data
|
ndarray
|
2D complex array representing the RDM. |
required |
title
|
str
|
The title for the plot. |
required |
cbar_min
|
float
|
The minimum value for the color bar. Defaults to -100. |
-100
|
volt_to_dbm
|
bool
|
If True, converts data from voltage to dBm for plotting. If False, plots power in Watts. Defaults to True. |
True
|
Returns:
| Type | Description |
|---|---|
tuple[Figure, Axes]
|
The figure and axes objects of the plot. |
Source code in src/rad_lab/rdm.py
186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 | |
plot_rdm_snr(rdot_axis, r_axis, data, title, cbar_min=0, volt_ratio_to_db=True)
Plots a range-Doppler matrix in terms of Signal-to-Noise Ratio (SNR).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rdot_axis
|
ndarray
|
1D array of range-rate values in m/s. |
required |
r_axis
|
ndarray
|
1D array of range values in meters. |
required |
data
|
ndarray
|
2D array representing the RDM with amplitudes as a linear SNR voltage ratio (i.e., S_voltage / N_voltage). |
required |
title
|
str
|
The title for the plot. |
required |
cbar_min
|
float
|
The minimum value for the color bar. Defaults to 0. |
0
|
volt_ratio_to_db
|
bool
|
If True, converts the SNR voltage ratio to dB. Defaults to True. |
True
|
Returns:
| Type | Description |
|---|---|
tuple[Figure, Axes]
|
The figure and axes objects of the plot. |
Source code in src/rad_lab/rdm.py
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 | |
plot_rtm(r_axis, data, title)
Plots the magnitude and phase of a range-time matrix (RTM).
The RTM shows radar data before Doppler processing, with range on one axis and pulse number (slow-time) on the other.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
r_axis
|
ndarray
|
1D array of range values in meters. |
required |
data
|
ndarray
|
2D complex array representing the RTM, with shape (num_range_bins, num_pulses). |
required |
title
|
str
|
The title for the plot. |
required |
Source code in src/rad_lab/rdm.py
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 | |
to_snr(datacube, radar, waveform)
Convert a Volt-domain RDM to SNR voltage ratio.
Normalises so the peak magnitude equals the range-equation SNR voltage
and the off-peak noise floor has voltage standard deviation of 1. Use
:func:~rad_lab._rdm_extras.verify_snr to verify against theory.
Derivation, with unit-amplitude pulse template (|p|=1 over duration
T, N_taps = T·fs samples) and raw (unscaled) matched filter:
- Per ADC sample: noise variance
σ² = R·N₀·fs. - After MF (raw sum over
N_tapsunit-amplitude taps): noise variance =N_taps · σ² = R·N₀·T·fs². - After coherent integration of
Npulses by the slow-time FFT: noise variance =N · R·N₀·T·fs².
So dividing by fs · sqrt(N · R·N₀·T) yields the SNR voltage ratio.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
datacube
|
ndarray
|
Processed RDM returned by :func: |
required |
radar
|
Radar
|
Same radar used to generate the RDM. |
required |
waveform
|
WaveformSample
|
Same waveform used to generate the RDM. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
np.ndarray: RDM normalised to SNR voltage ratio. |
Source code in src/rad_lab/rdm.py
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | |