sdr.average_power(x: NDArray, axis: int | tuple[int, ...] | None = None, db: bool = False) float

Measures the average power of a time-domain signal \(x[n]\).

\[P_{\text{avg}} = \frac{E}{N} = \frac{1}{N} \sum_{n=0}^{N-1} \left| x[n] \right|^2\]

Parameters:
x: NDArray

The time-domain signal \(x[n]\) to measure.

axis: int | tuple[int, ...] | None = None

Axis or axes along which to compute the average power. The default is None, which computes the average power of the entire array.

db: bool = False

Indicates whether to return the result in decibels (dB).

Returns:

The average power. If db=False, \(P_{\text{avg}}\) is returned. If db=True, \(10 \log_{10} P_{\text{avg}}\) is returned.