Skip to main content

Acoustic measurement toolkit: fractional octave-band filters, A/C/Z and time weighting, and sound level metrology per IEC 61260-1 and IEC 61672-1.

Project description

PyPI version Python versions License: MIT

CI Quality Gate codecov

DOI

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.

Magnitude response comparison of the five filter architectures for the 1 kHz octave band, with a zoom at the -3 dB crossover

✨ 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

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 Installation, first analysis, WAV files
Filter Banks Architectures, response gallery, band decomposition, zero-phase
Frequency Weighting A/C/Z curves, class 1 high-accuracy mode
Time Weighting Fast/Slow/Impulse ballistics, initial state
Levels Leq, LAeq, L10/L50/L90, octave spectrogram
Calibration and dBFS Physical SPL, digital full-scale, RMS vs peak
Block Processing Stateful streaming workflows
Multichannel Vectorized multichannel analysis, performance
API Reference Every public function and class
Theory Standards, math, design decisions
Why phonometry IEC compliance verification vs other libraries

⚡ Quick start

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}")
One-third-octave spectrum analysis of a multi-tone signal with the raw PSD in the background

1/3 Octave Band spectrum analysis of a complex signal. More examples in the documentation.

🧪 Development

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

phonometry-3.0.0.tar.gz (72.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

phonometry-3.0.0-py3-none-any.whl (42.8 kB view details)

Uploaded Python 3

File details

Details for the file phonometry-3.0.0.tar.gz.

File metadata

  • Download URL: phonometry-3.0.0.tar.gz
  • Upload date:
  • Size: 72.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.14

File hashes

Hashes for phonometry-3.0.0.tar.gz
Algorithm Hash digest
SHA256 de5ddd172d8e1c4a8c823f585bf7c74f8d4bf71c4d9911f1b6a3ba1bb639b1f3
MD5 0d68db29743eff12a701dc2c75500e52
BLAKE2b-256 2a12364c3f17fff00374d6d5a4d2c6ab96359d454875e9bc712f79ff08dd5702

See more details on using hashes here.

File details

Details for the file phonometry-3.0.0-py3-none-any.whl.

File metadata

  • Download URL: phonometry-3.0.0-py3-none-any.whl
  • Upload date:
  • Size: 42.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.14

File hashes

Hashes for phonometry-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7247efaebe33c6f9c6260aa1a5e99a5d8a1961419b7adc55f3a3419f53565db5
MD5 37901aff4d72f553c5944effd60f98e1
BLAKE2b-256 860f839ba1bbc9e06721548839c4a986514801c4d4a56f9f940b5bce038a7863

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page