class sdr.EnergyDetector

Implements an energy detector.

Notes

The null and alternative hypotheses are given by the following. The signal \(s[n]\) is assumed to be a complex-valued random process with noise variance \(\sigma_s^2\). The noise \(w[n]\) is assumed to be a complex-valued random process with noise variance \(\sigma^2\).

\[\mathcal{H}_0: x[n] = w[n]\]
\[\mathcal{H}_1: x[n] = s[n] + w[n]\]

The test statistic \(T(x)\) is given by:

\[T(x) = \sum\limits_{n=0}^{N-1} \left| x[n] \right|^2 > \gamma'\]
\[\begin{split} \frac{T(x)}{\sigma^2 / 2} \sim \chi_{2N}^2 & \text{ under } \mathcal{H}_0 \\ \frac{T(x)}{(\sigma_s^2 + \sigma^2) / 2} \sim \chi_{2N}^2 & \text{ under } \mathcal{H}_1 \end{split}\]

The probability of detection \(P_d\), probability of false alarm \(P_{fa}\), and detection threshold \(\gamma'\) are given by:

\[P_d = Q_{\chi_{2N}^2}\left( \frac{Q_{\chi_{2N}^2}^{-1}(P_{fa})}{\sigma_s^2 /\sigma^2 + 1} \right)\]
\[P_{fa} = Q_{\chi_{2N}^2}\left( \frac{\gamma'}{\sigma^2 / 2} \right)\]
\[\gamma' = \frac{\sigma^2}{2} Q_{\chi_N^2}^{-1}(P_{fa})\]

References

  • Steven Kay, Fundamentals of Statistical Signal Processing: Detection Theory, Sections 5.3.

Methods

static roc(snr, ...) tuple[NDArray[float64], NDArray[float64]]

Computes the receiver operating characteristic (ROC) curve.

static p_d(snr: ArrayLike, N_nc: ArrayLike, ...) NDArray[float64]

Computes the probability of detection \(P_d\).

static p_fa(threshold: ArrayLike, N_nc, ...) NDArray[float64]

Computes the probability of false alarm \(P_{fa}\).

static threshold(N_nc: ArrayLike, p_fa, ...) NDArray[float64]

Computes the threshold \(\gamma'\).