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[float_], NDArray[float_]]

Computes the receiver operating characteristic (ROC) curve.

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

Computes the probability of detection \(P_D\).

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

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

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

Computes the threshold \(\gamma'\).