Skip to content

Python Detection Statistics API

The doppler.detection module is the detection-theory layer over the C detection core: closed-form relationships between probability of detection (Pd), probability of false alarm (Pfa), SNR, and coherent dwell length for a square-law detector. Pair it with the streaming Detectordetection tells you what threshold and dwell to use, Detector runs the detection.

Every quantity comes in two forms: an amplitude-SNR version (det_*, SNR in dB) and a power-SNR version (det_*_power, linear power ratio).

from doppler.detection import det_threshold, det_pd, det_dwell, marcum_q

# Threshold for a target false-alarm rate, then Pd at a given SNR + dwell.
thr = det_threshold(pfa=1e-6)
pd  = det_pd(snr=10.0, dwell=8, threshold=thr)     # dB SNR

# How many frames must I integrate to reach Pd ≥ 0.9 at this Pfa?
n = det_dwell(snr=6.0, pd_min=0.9, pfa=1e-6, max_dwell=4096)

# The underlying Marcum Q-function is exposed directly.
q = marcum_q(1, 2.0, 3.0)

Amplitude-SNR (dB)

det_threshold

det_threshold(pfa: float) -> float

Det threshold.

det_pd

det_pd(snr: float, dwell: int, threshold: float) -> float

Det pd.

det_dwell

det_dwell(snr: float, pd_min: float, pfa: float, max_dwell: int) -> int

Det dwell.

det_snr

det_snr(dwell: int, pd_min: float, pfa: float) -> float

Det snr.


Power-SNR (linear)

det_threshold_power

det_threshold_power(pfa: float) -> float

Det threshold power.

det_pd_power

det_pd_power(snr_power: float, dwell: int, power_threshold: float) -> float

Det pd power.

det_dwell_power

det_dwell_power(snr_power: float, pd_min: float, pfa: float, max_dwell: int) -> int

Det dwell power.

det_snr_power

det_snr_power(dwell: int, pd_min: float, pfa: float) -> float

Det snr power.


Primitive

marcum_q

marcum_q(m: int, a: float, b: float) -> float

Marcum q.