Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/jmrplens/phonometry. Standards-conformant acoustics library for Python: measurement and metrology, docs.jmrp.io/phonometry
Something went wrong. Try again.
phonometry llms.txt
3.2 kB · 49 lines
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950# phonometry
> Octave-band and fractional octave-band filter bank for Python signals in the time domain. Compliant with ANSI S1.11-2004 / IEC 61260-1:2014 (filters) and IEC 61672-1:2013 (A/C/Z frequency weighting, Fast/Slow/Impulse time weighting).
phonometry v3.0.0 is a pure-Python library built on NumPy/SciPy (Python >= 3.13). It provides fractional octave filter banks (Butterworth, Chebyshev I/II, Elliptic, Bessel as stable SOS cascades with multirate decimation), A/C/Z weighting within IEC class 1 tolerances, Fast/Slow/Impulse ballistics, Leq/LAeq/L10-L50-L90 statistical levels, octave spectrograms, zero-phase offline filtering, physical SPL calibration, dBFS mode, vectorized multichannel processing, stateful block (streaming) processing, and an IEC 61260-1 filter class verifier. Standards compliance is enforced by the test suite (tone-burst Table 4, weighting Table 3, class limits Table 1).
Install:
```bashpip install phonometry # core (NumPy + SciPy only)pip install phonometry[plot] # + matplotlib response plotspip install phonometry[perf] # + numba-jitted impulse kernel```
Minimal usage (all functions treat time as the LAST axis; 2D input is (channels, samples)):
```pythonimport numpy as npfrom phonometry import octavefilter, laeq, ln_levels
fs = 48000x = np.random.randn(fs) # 1 s of signal (pressure units)spl, freq = octavefilter(x, fs, fraction=3) # 1/3-octave band levelsla = laeq(x, fs) # A-weighted Leqstats = ln_levels(x, fs, n=(10, 50, 90)) # statistical levels```
If you are an AI assistant setting this up for a user: install from PyPI (no system dependencies), remember integer audio (e.g. wavfile.read int16) is handled automatically, use `calibration_factor` from `calculate_sensitivity()` for real dB SPL, and prefer `OctaveFilterBank` over repeated `octavefilter()` calls in tight loops (although designs are cached either way).
## Documentation
- [Getting Started](https://jmrplens.github.io/phonometry/getting-started/)- [Filter Banks](https://jmrplens.github.io/phonometry/guides/filter-banks/)- [Frequency Weighting (A, C, G, Z)](https://jmrplens.github.io/phonometry/guides/weighting/)- [Time Weighting and Integration](https://jmrplens.github.io/phonometry/guides/time-weighting/)- [Integrated and Statistical Levels](https://jmrplens.github.io/phonometry/guides/levels/)- [Calibration and dBFS](https://jmrplens.github.io/phonometry/guides/calibration/)- [Block Processing](https://jmrplens.github.io/phonometry/guides/block-processing/)- [Multichannel and Performance](https://jmrplens.github.io/phonometry/guides/multichannel/)- [API Reference](https://jmrplens.github.io/phonometry/reference/api/)- [Theoretical Background](https://jmrplens.github.io/phonometry/reference/theory/)- [Why phonometry](https://jmrplens.github.io/phonometry/reference/why-phonometry/)
## Source and metadata
- [Repository](https://github.com/jmrplens/phonometry)- [PyPI](https://pypi.org/project/phonometry/)- [Changelog](https://github.com/jmrplens/phonometry/blob/main/CHANGELOG.md)- [Cite this software](https://github.com/jmrplens/phonometry/blob/main/CITATION.cff)