Octave-Band and Fractional Octave-Band filter for signals in time domain.
Project description
PyOctaveBand
Advanced Octave-Band and Fractional Octave-Band filter bank for signals in the time domain. Fully compliant with ANSI S1.11-2004 (Filters) and IEC 61672-1:2013 (Weighting).
✨ 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,LAeqandL10/L50/L90statistical 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 PyOctaveBand
Optional extras: PyOctaveBand[plot] (matplotlib for response plots), PyOctaveBand[perf] (numba for faster impulse ballistics), PyOctaveBand[full] (both).
📚 Documentation
Full documentation website: https://jmrplens.github.io/PyOctaveBand/ (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 PyOctaveBand | IEC compliance verification vs other libraries |
⚡ Quick start
import numpy as np
from pyoctaveband 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.
🧪 Development
make install # dependencies + editable install
make check # ruff + mypy + bandit + tests
make graphs # regenerate documentation images
See https://github.com/jmrplens/PyOctaveBand/blob/main/CONTRIBUTING.md and the https://github.com/jmrplens/PyOctaveBand/blob/main/CHANGELOG.md
📄 License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyoctaveband-2.0.0.tar.gz.
File metadata
- Download URL: pyoctaveband-2.0.0.tar.gz
- Upload date:
- Size: 65.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c4994d5acb5ca0d1a63786eb2d0a395207e64827fe807882b19d9911c7f1003
|
|
| MD5 |
c6a637a108b89db1f5aae92ad748bbe2
|
|
| BLAKE2b-256 |
1894bfa82f36ceff3356461e9a32e079b23fab3c6817d157a13503bd071a25c4
|
File details
Details for the file pyoctaveband-2.0.0-py3-none-any.whl.
File metadata
- Download URL: pyoctaveband-2.0.0-py3-none-any.whl
- Upload date:
- Size: 40.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e951e6ae146bff93a5a2e74514a3221c8c5f61fac6d75a1c6dba9c409f18a99a
|
|
| MD5 |
8890d6292a2de3443e53651f9c22f393
|
|
| BLAKE2b-256 |
b940ef432252354dcea96ef715c39ef334fd3f36614adab01fa5a6100b2744ec
|