Registry / data / gammatone

gammatone

JSON →
library1.0.3pypypiunverified

A Python implementation of gammatone filters for auditory modeling, including filterbank generation and cochleagram computation. Current version: 1.0.3 (patch release, adds f_max parameter to gtgram). Requires Python >=3.8.

pip install gammatone
INSTALL
IMPORT
SIG · GAMMATONE
G
gammatone
datapythonv1.0.3
Install
11.0s avg
Import
—
Disk
321MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v1.0.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 318.9MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 11.0s · import 0.000s · 306MB
321MB installed
● package 321MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Gammatone
✓ from gammatone import Gammatone
✗ from gammatone.gammatone_impl import Gammatone

Create a gammatone-based cochleagram from an audio signal.

import numpy as np from gammatone.gtgram import gtgram # Generate a cochleagram from a sample audio signal fs = 16000 duration = 0.1 t = np.linspace(0, duration, int(fs*duration), endpoint=False) signal = np.sin(2*np.pi*1000*t) # 1 kHz tone # Compute gammatone spectrogram (cochleagram) coch = gtgram(signal, fs, window_time=0.02, hop_time=0.01, channels=64, f_min=50, f_max=8000) print(coch.shape)
Debug
Known issues
gotchaThe default f_max in gtgram is 4000 Hz. If you need higher frequencies (e.g., for 22050 Hz audio), pass f_max explicitly. Added in v1.0.3.
fix
Call gtgram(... , f_max=8000) to extend coverage.
affects: <1.0.3
gotchaInput signal must be 1-D array. If you pass a 2-D array (e.g., stereo audio), it will fail silently or produce incorrect shape.
fix
Mono mix: signal = np.mean(signal, axis=1) for stereo.
affects: all
deprecatedDirect import from gammatone.gammatone (without _impl suffix) may be deprecated in future releases. Use gammatone.gammatone_impl for core filter classes.
fix
Use from gammatone.gammatone_impl import Gammatone
affects: >=1.0.0
Upgrade
Version history
1.0.3latest on PyPI · released Sep 10, 2024
Audit
Dependencies

No dependency data recorded yet.

Agent activity
15 hits · last 30 days
node
14
OpenAI (training)
1
Resources
gammatone — pip install gammatone · libregistry