NumPy RMS

0.6.0 · active · verified Sun Apr 12

numpy-rms is a fast Python library designed for calculating the Root Mean Square (RMS) of NumPy arrays. It leverages C implementations with SIMD acceleration (AVX on x86-64, NEON on ARM) to provide significant performance benefits, especially for 1-dimensional and 2-dimensional C-contiguous float32 arrays. The current version is 0.6.0, with a fairly active release cadence.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to import `numpy_rms` and calculate a series of RMS values for a 1D NumPy array with a specified window size. Ensure your input array is `float32` for optimal performance.

import numpy_rms
import numpy as np

arr = np.arange(40, dtype=np.float32)
rms_series = numpy_rms.rms(arr, window_size=10)
print(f"Original array shape: {arr.shape}")
print(f"RMS series shape: {rms_series.shape}")
print(f"First few RMS values: {rms_series[:5]}")

view raw JSON →