Skip to main content

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
  • 🧠 Loudness in sones three ways: Zwicker (ISO 532-1 Annex B validated), Moore-Glasberg stationary & time-varying (ISO 532-2/3) and Sottek Hearing Model (ECMA-418-2); DIN 45692 sharpness, ISO 226:2023 contours
  • 🎻 Sound-quality metrics: ECMA-418-2 tonality (tu_HMS) and roughness (asper)
  • 🗣️ Speech Transmission Index: STI and STIPA per IEC 60268-16 Ed. 5, with signal generator
  • 🎯 Tone prominence (TNR/PR, ECMA-418-1), environmental Lden/Ldn (ISO 1996-1), IEC 61252 noise dose
  • ↗️ Two-microphone sound intensity (IEC 61043) with ISO 9614-1 field indicators
  • 🏛️ Room & building acoustics: swept-sine/MLS impulse responses (ISO 18233), EDT/T20/T30/C50/C80/Ts (ISO 3382-1/2), open-plan speech metrics (ISO 3382-3), field airborne + impact + façade insulation with R′w/DnT,w/L′nT,w/D2m,nT,w and C/Ctr/CI (ISO 16283-1/2/3, ISO 717-1/2), laboratory R/Ln (ISO 10140), flanking-transmission prediction of R′w/L′n,w (EN 12354-1/2), measurement uncertainty (ISO 12999-1), sound absorption (ISO 354)
  • 🌬️ Outdoor propagation & occupational exposure: atmospheric absorption α(f) (ISO 9613-1), the ISO 9613-2 general method (divergence + atmospheric + ground + barrier terms) with a per-term octave-band breakdown, and daily noise exposure LEX,8h with task/job/full-day strategies and Annex C uncertainty (ISO 9612)
  • 🔊 Sound power LW three ways: enveloping-surface pressure (ISO 3744/3746), reverberation-room precision with Waterhouse/C1/C2 (ISO 3741), intensity scanning with field indicators and grade (ISO 9614-2)
  • 📏 Physical SPL calibration with IEC 60942:2017 stability validation, and dBFS modes
  • ⚡ Vectorized multichannel processing and stateful block (real-time) workflows

🚀 Installation

pip install phonometry

Optional extras: phonometry[plot] (matplotlib for response plots and result .plot() methods), 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, percentiles, LCpeak, SEL, noise dose (IEC 61252), Lden and rating levels (ISO 1996-1), octave spectrogram
Occupational Exposure ISO 9612 task-based, job-based and full-day strategies with the Annex C uncertainty budget (LEX,8h + U)
Tone Prominence ECMA-418-1 tone-to-noise ratio and prominence ratio with frequency-dependent prominence criteria
Psychoacoustics Zwicker (ISO 532-1), Moore-Glasberg (ISO 532-2/3) and Sottek (ECMA-418-2) loudness, sharpness (DIN 45692), equal-loudness contours (ISO 226), tonality & roughness (ECMA-418-2)
Speech Transmission STI/STIPA (IEC 60268-16): modulation transfer function, indirect method from impulse responses and direct STIPA measurement
Speech Intelligibility Index SII (ANSI S3.5-1997): band importance, masking and audibility, the index in noise and hearing loss, standard vocal-effort spectra
Electroacoustics Distortion (IEC 60268-3): THD, nth-order harmonic, THD+N & SINAD (AES17), SMPTE & CCIF intermodulation, DIM and weighted THD; frequency response & coherence (Bendat & Piersol H1/H2)
Underwater Acoustics Reference levels re 1 µPa (SPL, SEL, peak; ISO 18405); ship radiated noise & equivalent monopole source level (ISO 17208); pile-driving single-strike, peak & cumulative SEL (ISO 18406)
Underwater Sound Propagation Transmission loss (geometrical spreading + volume absorption: Francois-Garrison, Ainslie-McColm, Thorp); speed of sound in sea water (UNESCO/Chen-Millero, Del Grosso, Mackenzie); passive & active sonar equation; seabed reflection loss (Rayleigh); ocean ambient noise (Wenz wind/thermal + JOMOPANS-ECHO ship traffic); numerical solvers (normal modes, ray tracing, parabolic equation)
Aircraft Noise Effective Perceived Noise Level (ICAO Annex 16): perceived noisiness & PNL, tone correction, 10 dB-down duration correction (EPNL); IEC 61265 measurement-system verification; SAE ARP 5534 one-third-octave-band atmospheric absorption; ECAC Doc 29 noise-power-distance (NPD) event-level interpolation
Wind-Turbine Noise Apparent sound power level referred to the rotor centre and tonal audibility (Zwicker critical band, masking-noise level, audibility criterion) — IEC 61400-11
Sound Intensity Two-microphone p-p intensity (IEC 61043), ISO 9614-1 field indicators
Room Acoustics Impulse responses (ISO 18233), room parameters (ISO 3382-1/2), open-plan metrics (ISO 3382-3), sound absorption (ISO 354)
Building Acoustics Field airborne + impact + façade insulation and weighted ratings (ISO 16283-1/2/3, ISO 717-1/2), laboratory characterisation (ISO 10140), flanking-transmission prediction (EN 12354-1/2), measurement uncertainty (ISO 12999-1)
Outdoor Sound Propagation Atmospheric absorption α(f) (ISO 9613-1) and the ISO 9613-2 general method: geometrical divergence, atmospheric absorption, ground effect, barrier screening and meteorological correction
Sound Power Sound power level LW by enveloping surface (ISO 3744/3746), reverberation room (ISO 3741) and intensity scanning (ISO 9614-2)
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
Conformance report Live per-standard numerical validation (expected vs computed) regenerated by make conformance

⚡ Quick start

import numpy as np
from phonometry import octave_filter

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 = octave_filter(signal, fs=fs, fraction=3)

print(f"Bands: {freq}")
print(f"SPL [dB]: {spl}")

Since 3.2 the library also exposes twelve domain namespaces (the flat API above remains the primary surface):

from phonometry import building, underwater

r = building.airborne_insulation(...)
tl = underwater.transmission_loss(...)
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

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.2.0.tar.gz (492.5 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.2.0-py3-none-any.whl (534.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for phonometry-3.2.0.tar.gz
Algorithm Hash digest
SHA256 28cd090e6dacb402db08c574ec6c96373490670045517de775c46443c7c83c2a
MD5 f68f3ea7b7d1363d70648e64d1a91196
BLAKE2b-256 50bc3003a26b2ca3b00e2c577a70fae28188f082dd4a4762f125bd1312d28790

See more details on using hashes here.

File details

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

File metadata

  • Download URL: phonometry-3.2.0-py3-none-any.whl
  • Upload date:
  • Size: 534.4 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 08a53f7d0732b2853ffeadd5a643cc8c03ab188eefe709d8fc0e0b09ce944be5
MD5 49da01df7f4936771a61e88ad2833dff
BLAKE2b-256 85712624df7433792c6d4b38faa7900d87342c7d6436adf0c4972cf5dbc97b4e

See more details on using hashes here.

Release history Release notifications | RSS feed

3.3.0

2 files

This release

3.2.0 This release

2 files

3.1.0

2 files

3.0.0

2 files

Supported by

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