Skip to main content

Perceptually-grounded spatial audio localization model implementing Bayesian inference for HRTF evaluation and individualization.

Project description

Bayesian Listener

Tired to run experiments with real listeners? This model simulates their behavior in a sound localisation task by offering a Bayesian model reproducing human directional sound localization performances.

Moreover, this package offers an explicit likelihood function for parameter estimation (how noisy is this participant in comparison to another one, or how do parameters change over listening conditions?) based on principled maximum likelihood estimation, and statistical model comparison (is this spatial feature better than this other one?).

The model combines an observer's prior expectations about source locations with spectral cues (via individual HRTF) and interaural timing/level differences, producing likelihood surfaces that characterize listener behavior in 3D space.

Key Features:

  • Fit localization behavior from behavioral data
  • Recover and validate model parameters with maximum likelihood estimation
  • Compare HRTF interpolation methods quantitatively
  • Generate synthetic responses for validation and analysis
  • Accelerated computation via just-in-time compilation with numba

Installation

pip install bayesian_listener

Requires Python 3.10 or higher.

Quick Start

from bayesian_listener import BayesianListener

hrtf_data = 'hrtf.sofa'

listener = BayesianListener(hrtf=hrtf_data)
listener.compute_template()
estimations = listener.localise()

print(estimations.spherical_elevation[..., 0:2])

See Getting Started for more detailed examples.

Documentation

  • Getting Started — Installation and first example
  • Guides — Task-oriented walkthroughs (fitting, simulation, HRTF comparison)
  • API Reference — Complete class and function documentation
  • Background — Statistical framework and equations

References

Barumerli, R., Majdak, P., Geronazzo, M., Meijer, D., Avanzini, F., & Baumgartner, R. (2023). A Bayesian model for human directional localization of broadband static sound sources. Acta Acustica, 7, 12. Paper

Barumerli, R., Brinkmann, F., Zanoni, E., Hoyer, A., Picinali, L., & Geronazzo, M. (2026). Statistical validation and full-sphere extension of a Bayesian model for human static sound localisation. Acta Acustica (under review). Pre-print

License

EUPL 1.2 (European Union Public Licence)

Authors

  • Roberto Barumerli — Main model implementation and validation
  • Fabian Brinkmann — Spherical harmonics interpolation and interface design
  • Anton Hoyer — Continuous integration, PyFAR and SOFAr integration
  • Emanuele Zanoni — Implementation validation

Acknowledgements

The original model was implemented in MATLAB within the Auditory Modeling Toolbox (AMT). This Python version incorporates code components from AMT (e.g., gammatone filtering). We are grateful to the AMT authors for sharing their work.

The spherical t-design grids bundled with this package were originally published by Manuel Gräf and redistributed by spaudiopy.

The VBAP interpolation algorithm is adapted from spaudiopy, based on Pulkki, V. (1997).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bayesian_listener-0.1.0.tar.gz (311.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bayesian_listener-0.1.0-py3-none-any.whl (316.0 kB view details)

Uploaded Python 3

File details

Details for the file bayesian_listener-0.1.0.tar.gz.

File metadata

  • Download URL: bayesian_listener-0.1.0.tar.gz
  • Upload date:
  • Size: 311.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for bayesian_listener-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c8416bf5a07601590f9c9afaee24f5d752ee36cc78677d9159c6448b1caf3076
MD5 00a40290c65875e024dd68e36786b6c8
BLAKE2b-256 1f905b88087816aa87c2c2ecc64cf0f2e212a935153be8ff73dc8d3ee54adf72

See more details on using hashes here.

File details

Details for the file bayesian_listener-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for bayesian_listener-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 daa20a6d067b28f89ae95846f0b7f8adf36f7b661ceeaa7e62bcf44e777f84f5
MD5 adaf5f3f24125f0550d2fdcaf2f0e4fc
BLAKE2b-256 11b1c2c02b29aae23626f2b1ea2438bda41e37b0f2ec2b1d15f8aea066aa8e36

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page