librosax.feature.rms¶
- rms(*, y: ~jax.Array | None = None, S: ~jax.Array | None = None, frame_length: int = 2048, hop_length: int = 512, center: bool = True, pad_mode: str = 'constant', dtype: ~numpy.dtype = <class 'jax.numpy.float32'>) Array[source]¶
Compute root-mean-square (RMS) value for each frame.
Computing the RMS value from audio samples is faster as it doesn’t require a STFT calculation. However, using a spectrogram will give a more accurate representation of energy over time because its frames can be windowed.
- Parameters:
y – (optional) Audio time series. Required if S is not input.
S – (optional) Spectrogram magnitude. Required if y is not input.
frame_length – Length of analysis frame (in samples) for energy calculation
hop_length – Hop length for STFT
center – If True and operating on time-domain input (y), pad the signal by frame_length//2 on either side. Has no effect on spectrogram input.
pad_mode – Padding mode for centered analysis
dtype – Data type of the output array
- Returns:
RMS value for each frame [shape=(…, 1, t)]
- Return type:
jnp.ndarray