Skip to content

Config

config

Configuration dataclass for PyGaborSTM.

Default values match Bellur & Elhilali (2017).

Config dataclass

Config(use_gpu: bool = False, sample_rate: int = 16000, n_filters: int = 128, f_min: float = 180.0, octaves: float = 5.3, tau_ms: float = 8.0, frmlen_ms: float = 16.0, rates: ndarray = (lambda: copy())(), scales: ndarray = (lambda: copy())(), resolution: str = 'low', rsf_frame_size_ms: int = 500, rsf_frame_shift_ms: int = 10)

Configuration for the full PyGaborSTM pipeline.

PARAMETER DESCRIPTION
use_gpu

If True, use CuPy for GPU acceleration. Silently falls back to NumPy with a warning if CuPy is unavailable.

TYPE: bool DEFAULT: False

sample_rate

Audio sample rate in Hz. Must match the input signal.

TYPE: int DEFAULT: 16000

n_filters

Number of cochlear (gammatone) channels in the spectrogram stage.

TYPE: int DEFAULT: 128

f_min

Lowest filter center frequency in Hz.

TYPE: float DEFAULT: 180.0

octaves

Total frequency range in octaves. f_max = f_min * 2**octaves.

TYPE: float DEFAULT: 5.3

tau_ms

Time constant (ms) for the leaky-integration stage of the spectrogram.

TYPE: float DEFAULT: 8.0

frmlen_ms

Spectrogram frame length in ms (downsampling factor after y5).

TYPE: float DEFAULT: 16.0

rates

Base set of temporal modulation rates (Hz). Used as anchor points; resolution may interpolate additional rates between them.

TYPE: ndarray DEFAULT: ``STANDARD_RATES``

scales

Base set of spectral modulation scales (cycles/octave). Anchor points for resolution interpolation.

TYPE: ndarray DEFAULT: ``STANDARD_SCALES``

resolution

Density multiplier for the rate and scale grids. Each level doubles the number of kernels along both axes.

TYPE: (low, medium, high, ultra, max, overkill) DEFAULT: "low"

rsf_frame_size_ms

RSF integration window length in ms.

TYPE: int DEFAULT: 500

rsf_frame_shift_ms

RSF hop size in ms.

TYPE: int DEFAULT: 10