Metadata-Version: 2.4
Name: resonators
Version: 0.1.1
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Multimedia :: Sound/Audio :: Analysis
Classifier: Topic :: Scientific/Engineering
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Requires-Dist: numpy>=1.22
License-File: LICENSE-MIT
License-File: LICENSE-APACHE
Summary: Rust implementation of the Resonate algorithm for low-latency spectral analysis.
Keywords: audio,dsp,spectral-analysis,real-time,resonate
Home-Page: https://github.com/jhartquist/resonators
Author-email: John Hartquist <john@hartquist.com>
License-Expression: MIT OR Apache-2.0
Requires-Python: >=3.9
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Documentation, https://github.com/jhartquist/resonators
Project-URL: Homepage, https://github.com/jhartquist/resonators
Project-URL: Repository, https://github.com/jhartquist/resonators

# resonators (Python)

Python bindings for [resonators](https://github.com/jhartquist/resonators), a Rust implementation of Alexandre François's [Resonate algorithm][resonate] for low-latency spectral analysis.

See the [main repository](https://github.com/jhartquist/resonators) for details, demos, benchmarks, and attribution.

[resonate]: https://alexandrefrancois.org/Resonate/

## Install

```sh
pip install resonators
```

## Quickstart

```python
import numpy as np
from resonators import ResonatorBank

sample_rate = 44_100.0
freqs = np.array([110, 220, 440, 880], dtype=np.float32)
bank = ResonatorBank(freqs, sample_rate)  # alphas default to a per-frequency heuristic

t = np.arange(sample_rate, dtype=np.float32) / sample_rate
signal = np.sin(2 * np.pi * 440.0 * t).astype(np.float32)
spectrogram = bank.resonate(signal, hop=256)  # shape (n_frames, n_bins), complex64
```

## License

Dual-licensed under MIT or Apache-2.0, at your option.

