[](https://pypi.org/project/phonometry/)
[](https://pypi.org/project/phonometry/)
[](https://github.com/jmrplens/phonometry/blob/main/LICENSE)
[](https://github.com/jmrplens/phonometry/actions/workflows/python-app.yml)
[](https://sonarcloud.io/summary/overall?id=jmrplens_phonometry)
[](https://codecov.io/gh/jmrplens/phonometry)
[](https://doi.org/10.5281/zenodo.21215280)
# phonometry
> *phonometry* β the measurement of sound. Formerly published as **PyOctaveBand**.
Acoustic measurement toolkit for Python: fractional octave-band filter banks, frequency and time weighting, and sound level metrology β conformance-tested against **IEC 61260-1:2014 / ANSI S1.11-2004** (filters) and **IEC 61672-1:2013** (weighting and levels) class 1 tolerance limits.
## β¨ Highlights
- ποΈ 1/1, 1/3 and arbitrary fractional octave filter banks (stable SOS + multirate decimation)
- ποΈ Five architectures: Butterworth, Chebyshev I/II, Elliptic, Bessel β all with β3 dB points on the ANSI band edges
- π A/C/Z frequency weighting within IEC 61672-1 class 1 tolerances
- β±οΈ Fast/Slow/Impulse time ballistics, `Leq`, `LAeq` and `L10/L50/L90` statistical levels
- πΊοΈ Octave spectrogram (band levels over time) and zero-phase offline filtering
- π Physical SPL calibration and dBFS modes
- β‘ Vectorized multichannel processing and stateful block (real-time) workflows
## π Installation
```bash
pip install phonometry
```
Optional extras: `phonometry[plot]` (matplotlib for response plots), `phonometry[perf]` (numba for faster impulse ballistics), `phonometry[full]` (both).
## π Documentation
**Full documentation website: https://jmrplens.github.io/phonometry/** (English / EspaΓ±ol)
Or browse the Markdown docs on GitHub:
| Page | Contents |
| :--- | :--- |
| [Getting Started](https://github.com/jmrplens/phonometry/blob/main/docs/getting-started.md) | Installation, first analysis, WAV files |
| [Filter Banks](https://github.com/jmrplens/phonometry/blob/main/docs/filter-banks.md) | Architectures, response gallery, band decomposition, zero-phase |
| [Frequency Weighting](https://github.com/jmrplens/phonometry/blob/main/docs/weighting.md) | A/C/Z curves, class 1 high-accuracy mode |
| [Time Weighting](https://github.com/jmrplens/phonometry/blob/main/docs/time-weighting.md) | Fast/Slow/Impulse ballistics, initial state |
| [Levels](https://github.com/jmrplens/phonometry/blob/main/docs/levels.md) | Leq, LAeq, L10/L50/L90, octave spectrogram |
| [Calibration and dBFS](https://github.com/jmrplens/phonometry/blob/main/docs/calibration.md) | Physical SPL, digital full-scale, RMS vs peak |
| [Block Processing](https://github.com/jmrplens/phonometry/blob/main/docs/block-processing.md) | Stateful streaming workflows |
| [Multichannel](https://github.com/jmrplens/phonometry/blob/main/docs/multichannel.md) | Vectorized multichannel analysis, performance |
| [API Reference](https://github.com/jmrplens/phonometry/blob/main/docs/api-reference.md) | Every public function and class |
| [Theory](https://github.com/jmrplens/phonometry/blob/main/docs/theory.md) | Standards, math, design decisions |
| [Why phonometry](https://github.com/jmrplens/phonometry/blob/main/docs/why-phonometry.md) | IEC compliance verification vs other libraries |
## β‘ Quick start
```python
import numpy as np
from phonometry import octavefilter
fs = 48000
t = np.linspace(0, 1, fs, endpoint=False)
# Composite signal: 100Hz + 1000Hz
signal = np.sin(2 * np.pi * 100 * t) + np.sin(2 * np.pi * 1000 * t)
# Apply 1/3 octave filter bank
spl, freq = octavefilter(signal, fs=fs, fraction=3)
print(f"Bands: {freq}")
print(f"SPL [dB]: {spl}")
```
*1/3 Octave Band spectrum analysis of a complex signal. More examples in the
[documentation](https://jmrplens.github.io/phonometry/).*
## π§ͺ Development
```bash
make install # dependencies + editable install
make check # ruff + mypy + bandit + tests
make graphs # regenerate documentation images
```
See https://github.com/jmrplens/phonometry/blob/main/CONTRIBUTING.md and the
https://github.com/jmrplens/phonometry/blob/main/CHANGELOG.md
## π License
[MIT](https://github.com/jmrplens/phonometry/blob/main/LICENSE)