Releases

Rust crate brings real-time spectral analysis to Python and WebAssembly

Resonators 0.1 turns Alexandre François’s Resonate into a Rust crate with Python and WebAssembly bindings, aiming at real-time spectrograms without buffering.

Sam Ortega2 min read
Published
Listen to this article0:00 min
Share this article:
Rust crate brings real-time spectral analysis to Python and WebAssembly
AI-generated illustration

A Rust crate that can stream a spectrogram into Python notebooks and a browser demo at the same time is a lot more interesting than a plain 0.1 tag suggests. Resonators takes Alexandre R.J. François’s Resonate algorithm and wraps it for real-time spectral analysis, with output that looks like an STFT or CQT but updates per sample, without the usual windowing or buffering loop.

That portability is the real hook. François’s original reference implementation, noFFT, leaned on C++ and Apple’s Accelerate framework, which kept it effectively in the macOS and iOS lane. The Rust rewrite was built to run across broader targets, including Ubuntu, and the project’s README says portability was paired with a push for portable SIMD and consistent numerical results across platforms. In other words, this is not just a language port; it is an attempt to make a specialized DSP method usable anywhere Rust already travels.

The design is built around a bank of independent resonators, each locked to a fixed frequency with its own time constant. That gives each bin its own time-frequency tradeoff, which is a very different mental model from the standard FFT pipeline most audio programmers reach for first. The crate’s benchmark script makes the intent plain by timing ResonatorBank against noFFT at a 44,100 Hz sample rate and a hop size of 256, with repeated warmups and runs. This is code written by someone who expects people to measure it, not just admire the idea.

The project’s reach gets wider with Python and WebAssembly bindings, built with PyO3, maturin, wasm-bindgen, wasm-pack, SIMD, criterion, cargo bench, and AudioWorkletNode in the stack. That puts Resonators on three useful tracks at once: desktop experimentation, ML feature extraction, and browser inference. The repo even includes a browser-based live demo that turns microphone input into a logarithmic frequency spectrogram, which is the sort of proof-of-life that matters when a DSP idea needs to escape the research sandbox.

The research line behind it already has momentum. Resonate was published in the Proceedings of the 50th Anniversary of the International Computer Music Conference 2025 in Boston, Massachusetts, during the June 8-14 event, and François says the paper won a Best Paper Award. He also says a follow-up paper, Real-Time, Low-Latency, High Resolution Audio Spectral Analysis: Phase Matters, will be presented at ICMC 2026 in May. Resonators feels like the software layer of that story: a low-latency, low-memory idea turned into a cross-ecosystem tool that can move from a Rust crate to Python code to a web page without changing the underlying analysis model.

Know something we missed? Have a correction or additional information?

Submit a Tip

Never miss a story.
Get Rust Programming updates weekly.

The top stories delivered to your inbox.

Free forever · Unsubscribe anytime

Discussion

More Rust Programming News