The CARFAC v2 Cochlear Model in Matlab, NumPy, and JAX
Richard F. Lyon, Rob Schonberger, Malcolm Slaney, Mihajlo Velimirović, Honglin Yu
TL;DR
CARFAC v2 advances the cochlear model by delivering cross-platform improvements (MATLAB, NumPy, JAX) with DC distortion fixes, high-frequency synchrony reduction via a revised IHC, and a differentiable impairment framework linked to ohc_health. Key methodological updates include relocating the AC highpass filter, introducing a two-capacitor IHC, a delay-per-stage option, and streamlined AGC smoothing, together with stronger AMT integration and broader testing. The NumPy and JAX implementations enable scalable parameter optimization and fast execution, with benchmarks indicating substantial speedups (notably in JAX) and support for differentiable training contexts. The work also documents a clear path toward richer neural-output representations and future porting to C++, supporting broader multi-model comparisons and potential clinical modeling of hearing impairment.
Abstract
The open-source CARFAC (Cascade of Asymmetric Resonators with Fast-Acting Compression) cochlear model is upgraded to version 2, with improvements to the Matlab implementation, and with new Python/NumPy and JAX implementations -- but C++ version changes are still pending. One change addresses the DC (direct current, or zero frequency) quadratic distortion anomaly previously reported; another reduces the neural synchrony at high frequencies; the others have little or no noticeable effect in the default configuration. A new feature allows modeling a reduction of cochlear amplifier function, as a step toward a differentiable parameterized model of hearing impairment. In addition, the integration into the Auditory Model Toolbox (AMT) has been extensively improved, as the prior integration had bugs that made it unsuitable for including CARFAC in multi-model comparisons.
