Signal Measurement

Basic time-domain metrics for characterising a signal’s amplitude, energy, and information content.

pyminidsp.dot(a, b)[source]

Compute the dot product of two vectors.

Compute the dot product of two vectors: the sum of element-wise products a[0]*b[0] + a[1]*b[1] + ...

If the arrays differ in length, only the first min(len(a), len(b)) elements are used.

pyminidsp.entropy(a, clip=False)[source]

Compute the normalized entropy of a distribution.

Returns a value between 0.0 (all energy concentrated in one bin) and 1.0 (energy spread equally across all bins).

Parameters:
  • a – Input distribution.

  • clip – If True, ignore negative values. If False, square all values first.

Return type:

float

pyminidsp.energy(a)[source]

Compute signal energy: sum of squared samples.

Compute signal energy: sum of squared samples.

\[E = \sum_{n=0}^{N-1} x[n]^2\]
pyminidsp.power(a)[source]

Compute signal power: energy / N.

Compute signal power: energy divided by the number of samples.

\[P = \frac{1}{N} \sum_{n=0}^{N-1} x[n]^2\]
pyminidsp.power_db(a)[source]

Compute signal power in decibels.

Compute signal power in decibels: 10 * log10(power).