rms()¶
- audmath.rms(x, *, axis=None, keepdims=False)[source]¶
Root mean square.
The root mean square for a signal of length is given by
where is the value of a single sample of the signal.
For an empty signal 0 is returned.
- Parameters
- Return type
- Returns
root mean square of input signal
Examples
>>> rms([]) np.float64(0.0) >>> rms([0, 1]) np.float64(0.7071067811865476) >>> rms([[0, 1], [0, 1]]) np.float64(0.7071067811865476) >>> rms([[0, 1], [0, 1]], keepdims=True) array([[0.70710678]]) >>> rms([[0, 1], [0, 1]], axis=1) array([0.70710678, 0.70710678])