sdr.energy(x: ArrayLike, axis: int | tuple[int, ...] | None = None, db: bool = False) NDArray[float_]

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

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

Parameters:
x: ArrayLike

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

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

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

db: bool = False

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

Returns:

The signal energy. If db=False, \(E\) is returned. If db=True, \(10 \log_{10} E\) is returned.