Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

phonometry, acoustic measurement toolkit for Python

PyPI version Python versions PyPI downloads License: MIT

CI Quality Gate codecov

DOI

phonometry

phonometry, the measurement of sound. Formerly published as PyOctaveBand.

Acoustic measurement toolkit for Python, from fractional octave-band filters, weighting and sound level metrology to psychoacoustics, rooms and buildings, materials, vibration, environmental, aircraft and underwater acoustics, electroacoustics and wave simulation. Every metric is implemented from its governing standard and numerically checked against it: the auto-generated conformance report runs 995 conformance checks across 77 domains and 408 standards, each pinning an expected normative value to the value the library computes, and CI regenerates it on every pull request. Filters are class 1 per IEC 61260-1:2014 / ANSI S1.11-2004 and weightings and levels class 1 per IEC 61672-1:2013.

All 995 conformance checks pass, across 77 domains and 408 standards

An 800 Hz plane wavefront sweeps through a hall of rigid columns in a 2D FDTD simulation; every column diffracts the front and the scattered wavelets interfere until the whole hall is filled

An 800 Hz wavefront threading a hall of columns, computed with the library's own 2D FDTD engine (phonometry.simulation) and rendered by the same script that generates every figure in the documentation.

🚀 Installation

pip install phonometry

Optional extras: phonometry[plot] (matplotlib for response plots and result .plot() methods), phonometry[perf] (numba for faster impulse ballistics), phonometry[report] (reportlab and svglib, so result .report() methods can render normative PDF fiches, whose figure panel also needs matplotlib), phonometry[audio] (python-soundfile, so phonometry.io also reads FLAC, AIFF, Ogg/Opus, MP3 and compressed WAV), phonometry[full] (all of the above).

I recommend pip install phonometry[full]: it brings matplotlib, numba, reportlab, svglib and soundfile in one go, so every feature of the library is enabled. The base install computes every metric on NumPy and SciPy alone — and that includes reading every linear measurement WAV (24-bit, multichannel EXTENSIBLE, RF64) through phonometry.io; the only things it leaves unavailable are the figures (.plot() and the filter response plots), the normative PDF fiches (.report()), the compiled kernel that speeds up the impulse time weighting, and the compressed audio formats. One licensing note on [audio]: it installs python-soundfile, whose wheel bundles libsndfile under the LGPL-2.1 (dynamically linked); the base install deliberately stays free of it.

One caveat about [full]: numba is the only extra that caps NumPy, and it raises that cap only once it supports a new NumPy minor. So in the weeks after a NumPy minor release, phonometry[full] (like phonometry[perf]) can resolve one minor behind what a plain install gets. numba only makes the impulse time weighting faster, so if you need the newest NumPy the day it ships, install phonometry[plot,report] and leave [perf] out.

⚡ Quick start

import numpy as np
from phonometry import filters

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 = filters.octave_filter(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.

✨ What's inside

The library is organized into domain namespaces, and a function is reached through the one that owns it. Reading the domain at the call site is the point: two packages can hold a transmission_loss without either being renamed, and the line says which one it means.

from phonometry import building, underwater

r = building.airborne_insulation(...)
pl = underwater.propagation_loss(...)
Namespace Coverage
filters 1/1, 1/3 and arbitrary fractional octave filter banks (stable SOS + multirate decimation) in five architectures with per-band class verdicts (IEC 61260-1 / ANSI S1.11); A/C/Z weighting within IEC 61672-1 class 1 tolerances plus G weighting (ISO 7196); Fast/Slow/Impulse ballistics; octave spectrogram and zero-phase filtering; RBJ parametric equalizer sections
signals Leq, SEL, L10/L50/L90 and noise dose (IEC 61252); calibrated Welch PSD/CSD with chi-square confidence intervals, coherent output spectrum, 1/n-octave smoothing and colored-noise generators (Bendat & Piersol); MISO multiple/partial coherence; correlation and GCC time-delay estimation (Knapp & Carter); Hilbert envelope, cepstrum and echoes, time synchronous averaging, calibrated STFT and zoom FFT; regularized inverse filtering for system measurement; IEC 60268-1 tone bursts and resampling
metrology Physical SPL calibration with IEC 60942 stability validation and dBFS modes; GUM uncertainty with Monte Carlo (ISO/IEC Guide 98-3 and Supplement 1); Bendat & Piersol data qualification (stationarity, trends, level crossings, peak statistics); IEC 61043 intensity-instrument class verification
io Measurement audio files: every linear WAV a meter writes (PCM at any depth, EXTENSIBLE, RF64/BW64) read into a calibrated Signal with its bext provenance (EBU Tech 3285); headers-only info(); block streaming into the stateful filters; BWF writing with exact codes, loud clipping, optional TPDF dither and measured R 128 loudness; the calibration sidecar; lossless conversion to and from FLAC with provenance intact
psychoacoustics Loudness in sones three ways: Zwicker (ISO 532-1 Annex B validated), Moore-Glasberg stationary and time-varying (ISO 532-2/3) and Sottek Hearing Model (ECMA-418-2); DIN 45692 sharpness; ECMA-418-2 tonality, roughness (asper) and fluctuation strength (vacil_HMS); tone prominence TNR/PR (ECMA-418-1); tonal audibility (ISO/PAS 20065); Fastl & Zwicker psychoacoustic annoyance; ISO 226:2023 contours
speech Speech Transmission Index STI/STIPA with signal generator (IEC 60268-16 Ed. 5); Speech Intelligibility Index (ANSI S3.5-1997) with the four band-importance procedures and the standard speech spectra; STOI and ESTOI
hearing Age-related thresholds (ISO 7029) and reference thresholds (ISO 389-7); noise-induced hearing loss with HTLAN (ISO 1999); daily noise exposure LEX,8h with Annex C uncertainty (ISO 9612)
room Swept-sine/MLS/Golay impulse responses (ISO 18233); EDT/T20/T30/C50/C80/Ts (ISO 3382-1/2); open-plan speech metrics (ISO 3382-3); reverberation-room absorption (ISO 354); reverberation-time prediction (Sabine to Arau-Puchades); total absorption of furnished rooms (EN 12354-6); image-source impulse responses and the steady-state field; room-noise criteria NC and RC Mark II (ANSI/ASA S12.2)
building Measurement: field airborne, impact and 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), survey method (ISO 10052), intensity method (ISO 15186), laboratory flanking (ISO 10848), heavy impact sources, floor-covering improvement (ISO 16251-1), reception-plate power (EN 15657) and measurement uncertainty (ISO 12999-1). Prediction: EN 12354-1/2 global and detailed models, façade and outdoor radiation (EN 12354-3/4), installed structure-borne sources (EN 12354-5), panel transmission theory (mass law, coincidence, double walls, slits and apertures), ceiling plenums, masonry cavity walls and resilient layers. Regulation: the Spanish CTE DB-HR
materials Absorbers: ratings αw with classes (ISO 11654) and uncertainty (ISO 12999-2), impedance-tube absorption, impedance and transmission loss (ISO 10534-1/2, ASTM E2611) plus a virtual FDTD tube, porous and multilayer models (Delany-Bazley, Miki, JCA, TMM with MPP and membranes), Biot poroelasticity and slow-sound metamaterial absorbers at critical coupling. Diffusers: scattering and diffusion coefficients (ISO 17497-1/2), Schroeder diffuser design and far-field prediction, deep-subwavelength metadiffusers. Surfaces: in-situ road-surface absorption (ISO 13472-1/2). Resilient: dynamic stiffness of layers under floating floors (EN 29052-1)
emission Sound power by enveloping surface (ISO 3744/3746), reverberation room (ISO 3741), precision anechoic rooms (ISO 3745) and intensity scanning with field indicators and grades (ISO 9614-2/3) and the discrete-point power summation of ISO 9614-1; two-microphone p-p intensity (IEC 61043); sound power from surface vibration (ISO/TS 7849); noise-emission declarations (ISO 4871)
environment Sources: CNOSSOS-EU road and rail emission, wind-turbine apparent sound power and tonal audibility (IEC 61400-11). Propagation: atmospheric absorption (ISO 9613-1) and the ISO 9613-2 general method with per-term octave breakdown, spherical ground effect and wave-theoretic barriers, refraction ray tracing and the GFPE. Assessment: rating levels, Lden/Ldn and adjustments (ISO 1996-1/2), impulsive-sound prominence (NT ACOU 112) and the Spanish RD 1367/2007
aircraft EPNL certification chain (ICAO Annex 16) with IEC 61265 verification and SAE ARP 5534 absorption; airport noise contours (ECAC Doc 29) with the EASA ANP fleet database; rotorcraft hemisphere method (ECAC Doc 32)
underwater Levels re 1 µPa (ISO 18405); ship radiated noise (ISO 17208-1/2); pile driving (ISO 18406); ship-traffic source levels (JOMOPANS-ECHO) and Wenz ambient noise; sonar equation and detection range; sound speed and seabed reflection; propagation loss from spreading laws and Weston's shallow-water regimes to normal-mode, ray, Gaussian-beam and parabolic-equation solvers; marine-mammal audiograms and regulatory auditory weighting (NMFS 2024/2018, Southall et al. 2019)
vibration Human vibration: weightings (ISO 8041-1), whole-body metrics and buildings (ISO 2631-1/2), multiple shocks (ISO 2631-5), hand-arm and A(8) (ISO 5349); mobility and the FRF family (ISO 7626); isolator transfer stiffness (ISO 10846); plate-junction transmission and Kij; radiation efficiency and point mobilities
electroacoustics Distortion per IEC 60268-3: THD, THD+N and SINAD (AES17), SMPTE/CCIF intermodulation and DIM; swept-sine harmonic separation and THD(f) (Farina, Novak synchronized sweep); frequency response and coherence; rigid-piston radiation; loudspeaker and microphone rated characteristics (IEC 60268-5/-4)
noise_control Reactive silencers by the four-pole transmission-matrix method; HVAC duct elements and flow noise; machine enclosures
broadcast ITU-R BS.1770-5 programme loudness and true peak in dBTP; EBU R 128 with the Tech 3341 EBU Mode meters and Tech 3342 loudness range, validated against the official EBU signals
simulation Deterministic 2D acoustic FDTD with sources, probes, rasterised obstacles and rigid/impedance/absorbing boundaries; elastic P-SV solver with free surfaces and fluid-solid interfaces; near-to-far-field transform

Cross-cutting, everywhere in the library:

  • 📄 Typed, frozen result dataclasses with .plot(language="en"|"es") figures, and normative .report() PDF fiches for the metrics with a standardized reporting format (ISO 717, ISO 11654, ISO 532-1, EBU R 128, ICAO EPNL, IEC 61260-1, ISO 4871, IEC 60268-5/-4)
  • ⚡ Vectorized multichannel processing and stateful block (real-time) workflows
  • 🌐 Documentation fully in English and Spanish
Magnitude response comparison of the five filter architectures for the 1 kHz octave band, with a zoom at the -3 dB crossover

The five filter architectures on the 1 kHz octave band, with the −3 dB points on the ANSI band edges.

📚 Documentation

Full documentation website: https://jmrplens.github.io/phonometry/ (English / Español)

The same content is browsable as Markdown in docs/; a map of where to start:

Area Guides
Getting started Getting Started · Build a sound level meter · Calibration and dBFS
Filters, levels & weighting Filter Banks · Filter Gallery · Levels · Environmental Levels · Spanish Noise Regulation · Frequency Weighting · Special Weightings · Time Weighting · Block Processing · Multichannel
Signal analysis Calibrated spectral analysis · Correlation, time delay & envelope · Time-frequency analysis · System measurement · Measurement uncertainty
Psychoacoustics & sound quality Loudness · Advanced Loudness · Sound Quality Metrics · Tone Prominence · Psychoacoustic annoyance
Speech & hearing Speech Transmission Index · Speech Intelligibility Index · Objective intelligibility · Noise-induced hearing loss · Occupational exposure
Rooms & buildings Room Acoustics · Field Insulation · Low-Frequency Procedure (ISO 16283) · Laboratory Insulation · Predicting Insulation (EN 12354) · Image Sources · Impulse Response (ISO 18233) · Open-Plan Offices · Insulation Ratings (ISO 717) · Façade Insulation · Spanish Building Code (CTE DB-HR) · Survey Method (ISO 10052) · Insulation by Intensity · Impact Improvement · Flanking (ISO 10848)
Materials & surfaces Porous Absorbers · Metamaterial Absorbers · Diffusers · Metadiffusers · Impedance Tube · Absorption Measurement · Airflow Resistance · Road Absorption
Environment & outdoors Outdoor Propagation · CNOSSOS-EU Road Emission · Ground & Barriers · Atmospheric Refraction
Transport Aircraft Noise · Rotorcraft Noise · Wind-Turbine Noise · Airport Noise
Underwater Underwater Acoustics · Underwater Propagation · Underwater Solvers · Marine-Mammal Exposure
Vibration Human Vibration · Mechanical Mobility · Transfer Stiffness
Electroacoustics & broadcast Electroacoustics · Swept-Sine Distortion · Programme Loudness · Loudspeakers · Microphones
Emission Sound Power · Sound Intensity · Sound Power by Pressure · Reverberation Room · In Situ Comparison · By Intensity · Silencers · Filter Compliance
Simulation 2D FDTD Wave Simulation · Elastic Waves
Reference API Reference · Theory · Bibliography · Why phonometry · Conformance report · Standards errata

🧾 Citing

If phonometry is useful in your research, cite the archived release:

Requena-Plens, J. M. phonometry: acoustic measurement, analysis and prediction for Python. Zenodo. https://doi.org/10.5281/zenodo.21215280

The repository ships a CITATION.cff, so GitHub's Cite this repository button produces BibTeX and APA entries.

💚 Support the project

phonometry is one person's work, and its main cost is the primary sources: every metric is implemented from the governing standard's paid text. You can sponsor the project on GitHub, and the documentation keeps a live list of the sources that resisted every legitimate acquisition route, with four ways to help get them: fund the purchase, send a copy privately (whatever its origin, it is never republished), verify against your own licensed copy, or point at a channel that was missed.

🧪 Development

make install   # dependencies + editable install
make check     # ruff + mypy + bandit + tests
make graphs    # regenerate documentation images

See the contributing guide and the changelog. Suspected vulnerabilities go through GitHub's private reporting, as set out in the security policy.

📄 License

MIT

Metadata

Release files for phonometry 4.0.0rc1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for phonometry 4.0.0rc1
File Size Uploaded
phonometry-4.0.0rc1.tar.gz 2.7 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for phonometry 4.0.0rc1
File Interpreter ABI Platform
phonometry-4.0.0rc1-py3-none-any.whl Python 3 none any Details

Total release size: 5.5 MB

Release files / phonometry-4.0.0rc1.tar.gz

Download URL phonometry-4.0.0rc1.tar.gz
Size 2.7 MB
Tags Source
SHA-256 checksum
How to use checksums
b25572cc93941445d205fae54f531715249a9aaa8a4370ce6f442e50676f1dbe
BLAKE2b-256 checksum
How to use checksums
6c62b128db942e2ce6c91257dc387d31b97144bd9cf3b548848d4038189d8923
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / phonometry-4.0.0rc1-py3-none-any.whl

Download URL phonometry-4.0.0rc1-py3-none-any.whl
Size 2.8 MB
Tags Python 3
SHA-256 checksum
How to use checksums
9e8102884cac59626a17d22c3a68c14640790697ab5317634f9763f096a56335
BLAKE2b-256 checksum
How to use checksums
3fd0adaa8bf54fe3c831e217a22df314d0110953c931785bfcb6d4535a8de794
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release history Release notifications | RSS feed

This release

4.0.0rc1 This release

2 release files

3.3.0

2 release files

3.2.0

2 release files

3.1.0

2 release files

3.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page