Radar Models API¶
Radar equation and detection probability calculations.
Overview¶
from phased_array_systems.models.radar import (
RadarModel,
compute_detection_threshold,
compute_pd_from_snr,
compute_snr_for_pd,
albersheim_snr,
coherent_integration_gain,
noncoherent_integration_gain,
integration_loss,
)
Classes¶
RadarModel
¶
Radar range equation calculator.
Implements the monostatic radar range equation:
P_r = (P_t * G^2 * λ^2 * σ) / ((4π)^3 * R^4 * L_sys)
Or in dB form
SNR = P_t + 2G + 2λ_dB + σ_dBsm - 4*R_dB - L_sys - (4π)^3_dB - N_dB
Where
P_t = Peak transmit power (W) G = Antenna gain (same for Tx/Rx in monostatic) λ = Wavelength (m) σ = Target radar cross section (m^2) R = Range to target (m) L_sys = System losses N = Noise power = kTB
| ATTRIBUTE | DESCRIPTION |
|---|---|
name |
Model block name for identification
TYPE:
|
evaluate
¶
evaluate(arch: Architecture, scenario: RadarDetectionScenario, context: dict[str, Any]) -> MetricsDict
Evaluate radar detection performance.
| PARAMETER | DESCRIPTION |
|---|---|
arch
|
Architecture configuration
TYPE:
|
scenario
|
Radar detection scenario
TYPE:
|
context
|
Additional context (may include antenna metrics): - g_peak_db: Antenna gain (uses this if provided) - scan_loss_db: Scan loss (uses this if provided) - beamwidth_az_deg: Azimuth beamwidth (for clutter cell) - beamwidth_el_deg: Elevation beamwidth (for clutter cell)
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
MetricsDict
|
Dictionary with radar metrics: - peak_power_w: Peak transmit power (W) - peak_power_dbw: Peak transmit power (dBW) - g_ant_db: Antenna gain (dB) - wavelength_m: Wavelength (m) - target_rcs_dbsm: Target RCS (dBsm) - target_rcs_m2: Target RCS (m^2) - range_m: Target range (m) - noise_power_dbw: Noise power (dBW) - snr_single_pulse_db: Single-pulse SNR (dB) - integration_gain_db: Integration gain (dB) - snr_integrated_db: Integrated SNR (dB) - snr_required_db: Required SNR for Pd/Pfa (dB) - snr_margin_db: SNR margin (dB) - pd_achieved: Achieved probability of detection - detection_range_m: Max detection range for required Pd (m) - clutter_rcs_dbsm: Clutter RCS if applicable (dBsm) - scr_db: Signal-to-clutter ratio if applicable (dB) - scnr_db: Signal-to-clutter-plus-noise ratio (dB) - atmos_loss_db: Two-way atmospheric loss (dB) - rain_loss_db: Two-way rain attenuation (dB) - cfar_loss_db: CFAR processing loss (dB) |
Source code in src/phased_array_systems/models/radar/equation.py
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 120 121 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 152 153 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 184 185 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 234 235 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 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 | |
Functions¶
compute_snr_for_pd
¶
compute_snr_for_pd(pd: float, pfa: float, swerling: SwerlingModel = 0, n_pulses: int = 1, integration: Literal['coherent', 'noncoherent'] = 'noncoherent') -> float
Compute required SNR for given Pd and Pfa.
Inverse of compute_pd_from_snr using numerical root finding.
| PARAMETER | DESCRIPTION |
|---|---|
pd
|
Required probability of detection (0 < pd < 1)
TYPE:
|
pfa
|
Probability of false alarm (0 < pfa < 1)
TYPE:
|
swerling
|
Swerling target model (0-4)
TYPE:
|
n_pulses
|
Number of pulses integrated
TYPE:
|
integration
|
Integration type
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float
|
Required single-pulse SNR in dB |
Source code in src/phased_array_systems/models/radar/detection.py
compute_pd_from_snr
¶
compute_pd_from_snr(snr_db: float, pfa: float, swerling: SwerlingModel = 0, n_pulses: int = 1, integration: Literal['coherent', 'noncoherent'] = 'noncoherent') -> float
Compute probability of detection for given per-pulse SNR.
Square-law detector statistics. Conditioned on the total received signal power s (in noise-power units), the normalized detector output follows a noncentral chi-square distribution with 2n degrees of freedom and noncentrality 2s, so Pd = Q_chi2'(2T; 2n, 2s) where T is the normalized threshold. Swerling fluctuation is the gamma-distributed mixture of s:
Swerling 0: s = n*SNR (deterministic; Pd is the Marcum Q result)
Swerling 1: s ~ Gamma(1, n*SNR) (scan-to-scan Rayleigh)
Swerling 2: s ~ Gamma(n, SNR) (pulse-to-pulse Rayleigh; closed form)
Swerling 3: s ~ Gamma(2, n*SNR/2) (scan-to-scan chi-4)
Swerling 4: s ~ Gamma(2n, SNR/2) (pulse-to-pulse chi-4)
Coherent integration multiplies SNR by n and detects on a single sample; noncoherent integration uses the n-sample statistics directly (no separate empirical gain factor).
| PARAMETER | DESCRIPTION |
|---|---|
snr_db
|
Signal-to-noise ratio per pulse (dB)
TYPE:
|
pfa
|
Probability of false alarm
TYPE:
|
swerling
|
Swerling target model (0 = non-fluctuating)
TYPE:
|
n_pulses
|
Number of pulses integrated
TYPE:
|
integration
|
Integration type ("coherent" or "noncoherent")
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float
|
Probability of detection (0-1) |
Source code in src/phased_array_systems/models/radar/detection.py
albersheim_snr
¶
Albersheim's equation for required SNR (Swerling 0).
Empirical approximation valid for: - 0.1 <= Pd <= 0.99 - 1e-9 <= Pfa <= 1e-3 - 1 <= n_pulses <= 8096
| PARAMETER | DESCRIPTION |
|---|---|
pd
|
Probability of detection
TYPE:
|
pfa
|
Probability of false alarm
TYPE:
|
n_pulses
|
Number of pulses (non-coherent integration)
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float
|
Required single-pulse SNR in dB |
Source code in src/phased_array_systems/models/radar/detection.py
coherent_integration_gain
¶
Coherent integration gain in dB.
Coherent integration (phase-preserving) provides full N-times improvement in SNR because signals add coherently while noise adds incoherently.
| PARAMETER | DESCRIPTION |
|---|---|
n_pulses
|
Number of pulses integrated (must be >= 1)
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float
|
Integration gain in dB: 10 * log10(n_pulses) |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If n_pulses < 1 |
Source code in src/phased_array_systems/models/radar/integration.py
noncoherent_integration_gain
¶
Non-coherent integration gain in dB.
Non-coherent integration (magnitude-only) provides less than full N-times gain because both signal and noise magnitudes are combined. The efficiency depends on SNR and Pd/Pfa.
Uses empirical approximation: gain ≈ 10 * log10(n^efficiency) where efficiency ≈ 0.8 for typical radar parameters.
| PARAMETER | DESCRIPTION |
|---|---|
n_pulses
|
Number of pulses integrated (must be >= 1)
TYPE:
|
pd
|
Probability of detection (affects efficiency)
TYPE:
|
pfa
|
Probability of false alarm (affects efficiency)
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float
|
Integration gain in dB (always <= coherent gain) |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If n_pulses < 1 |
Source code in src/phased_array_systems/models/radar/integration.py
Output Metrics¶
| Metric | Units | Description |
|---|---|---|
snr_single_pulse_db |
dB | Single-pulse SNR |
snr_integrated_db |
dB | SNR after integration |
snr_required_db |
dB | Required SNR for Pd/Pfa |
snr_margin_db |
dB | Margin above required |
detection_range_m |
m | Maximum detection range |
integration_gain_db |
dB | Gain from pulse integration |
Usage Examples¶
Using RadarModel¶
from phased_array_systems.models.radar import RadarModel
from phased_array_systems.scenarios import RadarDetectionScenario
scenario = RadarDetectionScenario(
freq_hz=10e9,
bandwidth_hz=100e3,
range_m=100e3,
target_rcs_dbsm=0.0,
pd_required=0.9,
pfa=1e-6,
prf_hz=1000,
n_pulses=10,
integration_type="coherent",
swerling=1,
)
model = RadarModel()
metrics = model.evaluate(arch, scenario, context={})
print(f"Single-Pulse SNR: {metrics['snr_single_pulse_db']:.1f} dB")
print(f"Integrated SNR: {metrics['snr_integrated_db']:.1f} dB")
print(f"SNR Margin: {metrics['snr_margin_db']:.1f} dB")
Computing Required SNR¶
from phased_array_systems.models.radar import compute_snr_for_pd
snr_req = compute_snr_for_pd(
pd=0.9,
pfa=1e-6,
swerling=1,
)
print(f"Required SNR: {snr_req:.1f} dB")
Computing Detection Probability¶
from phased_array_systems.models.radar import compute_pd_from_snr
pd = compute_pd_from_snr(
snr_db=15.0,
pfa=1e-6,
swerling=1,
)
print(f"Detection Probability: {pd:.3f}")
Integration Gain¶
from phased_array_systems.models.radar import coherent_integration_gain, noncoherent_integration_gain
# Coherent integration
gain_coherent = coherent_integration_gain(n_pulses=16)
print(f"Coherent Gain: {gain_coherent:.1f} dB") # 12.0 dB
# Non-coherent integration
gain_noncoherent = noncoherent_integration_gain(n_pulses=16)
print(f"Non-coherent Gain: {gain_noncoherent:.1f} dB") # ~6.0 dB
Radar Range Equation¶
Where:
- \(P_t\) = Peak transmit power (W)
- \(G\) = Antenna gain (linear)
- \(\lambda\) = Wavelength (m)
- \(\sigma\) = Target RCS (m²)
- \(R\) = Target range (m)
- \(k\) = Boltzmann constant
- \(T_s\) = System noise temperature (K)
- \(B_n\) = Noise bandwidth (Hz)
- \(L_s\) = System losses (linear)
Swerling Models¶
| Model | Decorrelation | |
|---|---|---|
| 0 | Constant | None |
| 1 | Rayleigh | Scan-to-scan |
| 2 | Rayleigh | Pulse-to-pulse |
| 3 | Chi-squared (4 DOF) | Scan-to-scan |
| 4 | Chi-squared (4 DOF) | Pulse-to-pulse |
MTI Clutter Suppression¶
Doppler-domain clutter rejection. See Theory: MTI Clutter Suppression.
clutter_spectral_std_hz
¶
sigma_c = 2 sigma_v / lambda (Skolnik ch. 15).
The velocity spread is a property of the clutter, not the radar, so the same wooded hillside produces a wider Doppler spectrum at higher frequency.
Source code in src/phased_array_systems/models/radar/mti.py
normalized_clutter_spread_rad
¶
sigma_omega = 2 pi sigma_c / PRF, the spread in normalized angular frequency.
This is the only clutter quantity the canceller math needs: everything downstream depends on the spectrum's width relative to the PRF, not on its absolute width.
Source code in src/phased_array_systems/models/radar/mti.py
clutter_autocorrelation
¶
rho_c[k] = exp(-(sigma_omega k)^2 / 2), Richards FRSP Eq. (5.53).
The normalized autocorrelation of a Gaussian clutter spectrum, valid for sigma_omega << pi. At the wide-spectrum limit the approximation breaks down along with the premise that the clutter is narrowband relative to the PRF.
Source code in src/phased_array_systems/models/radar/mti.py
canceller_weights
¶
Binomial (N-1)th-difference canceller weights w_k = (-1)^k C(N-1, k).
N = 2 gives [1, -1] and N = 3 gives [1, -2, 1], the conventional two- and three-pulse cancellers.
Source code in src/phased_array_systems/models/radar/mti.py
mti_signal_gain
¶
Average signal gain over all Doppler shifts, G = sum_k w_k^2.
Richards FRSP p. 246 defines the gain as the mean of |H(F)|^2 over the unambiguous Doppler band, which for an FIR filter is the sum of the squared weights by Parseval. Gives G = 2 (3.0 dB) for the two-pulse canceller and G = 6 (7.8 dB) for the three-pulse, matching FRSP p. 247.
The target velocity is assumed unknown a priori; a radar that knows where to look does better than this average.
Source code in src/phased_array_systems/models/radar/mti.py
mti_improvement_factor
¶
Improvement factor I = G * CA for an N-pulse binomial canceller.
Computed from the general quadratic form
I = sum_k w_k^2 / sum_i sum_j w_i w_j rho_c[i-j]
rather than from the published closed forms, which it reproduces exactly: Richards FRSP Eq. (5.52) gives 1/(1 - rho[1]) for N = 2 and Eq. (5.54) gives 1/(1 - (4/3) rho[1] + (1/3) rho[2]) for N = 3. Both are asserted against this function in the oracle tests.
Returned as a linear ratio. The value grows without bound as the clutter spectrum narrows, which is physical -- perfectly stationary clutter is perfectly cancellable -- but a design should not lean on figures far beyond the system's phase noise and stability limits, which this model does not represent.
Source code in src/phased_array_systems/models/radar/mti.py
mti_clutter_attenuation
¶
CA = I / G, the clutter power ratio across the filter (FRSP Eq. 5.43).
Distinct from the improvement factor: this is rejection alone, with no credit for the filter's gain on the target.
Source code in src/phased_array_systems/models/radar/mti.py
required_clutter_attenuation_db
¶
required_clutter_attenuation_db(target_rcs_dbsm: float, clutter_rcs_dbsm: float, required_scr_db: float) -> float
CA_req = (S/C)_required - (sigma_target - sigma_clutter), in dB.
How much clutter power must be removed for the target to clear the required signal-to-clutter ratio. Positive means suppression is needed.
Source code in src/phased_array_systems/models/radar/mti.py
blind_speed_ms
¶
v_blind = n PRF lambda / 2: target speeds the canceller nulls along with clutter.
A target at a blind speed produces the same phase advance per pulse as stationary clutter and is cancelled with it. The first blind speed bounds the useful Doppler coverage of a single-PRF MTI.
Source code in src/phased_array_systems/models/radar/mti.py
doppler_shift_hz
¶
f_d = 2 v_r / lambda, the monostatic two-way Doppler shift.
Source code in src/phased_array_systems/models/radar/mti.py
unambiguous_range_m
¶
Track Accuracy¶
Closed-form measurement error and steady-state track performance. See Theory: Track Accuracy for the equations and the SNR-convention note.
range_sigma_m
¶
sigma_R = dR / sqrt(2 * SNR), Curry Eq. (8.6) / POMR Eq. (18.33).
Thermal (SNR-driven) term only. Curry Eq. (8.5) adds fixed-random and bias terms in quadrature; those are hardware assertions, not consequences of the design, so they are left to the caller.
Source code in src/phased_array_systems/models/radar/tracking.py
angle_sigma_deg
¶
angle_sigma_deg(snr_db: float, beamwidth_deg: float, monopulse_slope: float = DEFAULT_MONOPULSE_SLOPE) -> float
sigma_theta = theta_3dB / (k_m * sqrt(2 * SNR)), POMR Eq. (18.63) / Curry Eq. (8.8).
Valid above MONOPULSE_SNR_FLOOR_DB; see the module note.
Thermal (SNR-driven) term only, as with :func:range_sigma_m. Curry
Eq. (8.7) adds fixed-random and bias terms in quadrature, and target glint
can dominate angular error at short range (Curry p. 170). None of those are
consequences of the array design, so they are left to the caller.
Source code in src/phased_array_systems/models/radar/tracking.py
scan_broadened_beamwidth_deg
¶
theta_phi = theta_B / cos(phi), Curry Eq. (8.9).
A phased array's beam broadens off broadside, so angle accuracy degrades with scan angle even at constant SNR.
Source code in src/phased_array_systems/models/radar/tracking.py
crossrange_sigma_m
¶
sigma_D = R * sigma_A, Curry Eq. (8.10). Angle in degrees, result in metres.
Source code in src/phased_array_systems/models/radar/tracking.py
velocity_sigma_ms
¶
sigma_V = lambda / (2 tau sqrt(2 SNR)), Curry Eq. (8.13).
Curry attributes the form to Barton & Ward, Handbook of Radar Measurement, pp. 101-103. Equivalent to POMR Eq. (18.31) under the convention noted in the module docstring.
Source code in src/phased_array_systems/models/radar/tracking.py
combine_angle_errors_deg
¶
Root-sum-square of independent angle error terms.
The seam that lets a thermal-noise angle error combine with the hardware
pointing error from models/antenna/errors.py: phase-shifter bits and
calibration residue then propagate all the way to track accuracy, which is
the connection no tracking library can make.
Source code in src/phased_array_systems/models/radar/tracking.py
tracking_index
¶
Random tracking index Gamma = sigma_v T^2 / sigma_w, POMR Eq. (19.47).
Kalata's parameter: the ratio of position uncertainty from target maneuverability to that from the sensor measurement. It is the single number that sets the steady-state filter.
Source code in src/phased_array_systems/models/radar/tracking.py
deterministic_tracking_index
¶
Gamma_D = A_max T^2 / sigma_w, POMR Eq. (19.59).
Source code in src/phased_array_systems/models/radar/tracking.py
process_noise_from_maneuver
¶
sigma_v = kappa_1_min(Gamma_D) * A_max, POMR Eqs. (19.63)/(19.66).
kappa_1_min = 0.87 - 0.09 log10(Gamma_D) - 0.02 [log10(Gamma_D)]^2
Lets the caller state a physical maneuver ("the target pulls 4 g") instead of tuning a process-noise variance. POMR fits the curve over 0.01 <= Gamma_D <= 10; outside that band the fit is extrapolated and the caller should treat the result as indicative.
Source code in src/phased_array_systems/models/radar/tracking.py
alpha_beta_gains
¶
Steady-state alpha-beta gains from the tracking index, POMR Eqs. (19.54)/(19.55).
Satisfies the Kalata relation beta = 2(2 - alpha) - 4 sqrt(1 - alpha) (Eq. 19.56) and inverts exactly through Gamma = beta / sqrt(1 - alpha).
Computed through a rearrangement rather than from Eqs. (19.54)/(19.55) literally, because those forms lose precision as alpha approaches 1: they build alpha from a difference of large terms and the caller then needs 1 - alpha, so the relative error in beta reaches 4e-5 by Gamma = 1e5. Substituting r = sqrt(1 - alpha) into Eq. (19.47) with Eq. (19.56) gives
Gamma = 2 (1 - r)^2 / r -> 2 r^2 - (4 + Gamma) r + 2 = 0
r = (4 + Gamma - sqrt(Gamma^2 + 8 Gamma)) / 4 (smaller root)
alpha = 1 - r^2, beta = 2 (1 - r)^2
which is the same solution with 1 - alpha carried exactly as r^2. It holds the identity to ~1e-12 at Gamma = 1e5. Both forms are pinned against each other in the oracle tests; this is presentation, not a different model.
Source code in src/phased_array_systems/models/radar/tracking.py
steady_state_sigmas
¶
steady_state_sigmas(sigma_w: float, alpha: float, beta: float, revisit_s: float) -> tuple[float, float]
Steady-state position and velocity RMS error, POMR Eq. (19.53).
P = sigma_w^2 * [[alpha, beta/T ], [beta/T, beta(2 alpha - beta)/(2(1-alpha)T^2)]]
so sigma_pos = sigma_w sqrt(alpha) and sigma_vel = (sigma_w/T) sqrt(beta(2 alpha - beta)/(2(1 - alpha))).
This is the total steady-state error, process noise included: it matches
the fixed-gain covariance recursion iterated to convergence with Q present.
For the no-maneuver figure use :func:variance_reduction_position.
Source code in src/phased_array_systems/models/radar/tracking.py
variance_reduction_position
¶
Sensor-noise-only VRR, Mahafza Eq. (11.94).
(VRR)_x = (2 alpha^2 - 3 alpha beta + 2 beta) / (alpha (4 - 2 alpha - beta))
Distinct from :func:steady_state_sigmas, and both are correct: this is
the variance ratio with the process noise removed (no maneuver), verified
against the Q = 0 covariance recursion. It answers "how much does filtering
reduce measurement noise", while Eq. (19.53) answers "how well is the
target actually located". A third form circulating in the literature,
(2 alpha^2 + 2 beta + alpha beta)/(alpha(4 - 2 alpha - beta)), is wrong: it
exceeds unity, i.e. claims filtering amplifies noise.
Source code in src/phased_array_systems/models/radar/tracking.py
maneuver_lag_m
¶
Maximum position MSE under a sustained maneuver, POMR Eq. (19.60).
MMSE_p = sigma_w^2 [ (2 alpha^2 + beta(2 - 3 alpha))/(alpha(4 - 2 alpha - beta)) + (1 - alpha)^2 Gamma_D^2 / beta^2 ]
Returned as an RMS distance. The second term is the deterministic lag: a filter tuned for a quiet target falls progressively behind a maneuvering one, and no amount of SNR fixes it.