Bayesian Listener
bayesian_listener is an open-source Python package for modelling full-sphere human sound localisation. Given a listener's HRTF and a set of source directions, it predicts localisation responses jointly in the lateral and polar dimensions.
It can also run model-based statistical analysis thanks to its explicit likelihood function that enables principled parameter estimation from behavioural data.
pip install bayesian_listener
What you can do with it
Simulate localisation with an individual HRTF — predict how a specific listener will localise sounds across the full sphere. → [Guide](https://bayesian-listener.readthedocs.io/en/latest/guides/understand.html#individual)
Evaluate non-individual HRTFs — swap the listener's own HRTF with a non-individual one and simulate the expected elevation bias. If the model reproduces the measured behaviour, the acoustic mismatch is likely the main driver; if not, the cause might be is perceptual or cognitive. → [Guide](https://bayesian-listener.readthedocs.io/en/latest/guides/understand.html#workflow-nonindividual)
Optimise experimental designs — run simulations across all planned conditions before collecting data, and focus measurements where the effect is largest. → [Guide](https://bayesian-listener.readthedocs.io/en/latest/guides/simulate_responses.html)
Fit perceptual parameters from behavioural data — maximum likelihood estimation from as few as 100 localisation trials and one HRTF, with fully interpretable machinery. → [Guide](https://bayesian-listener.readthedocs.io/en/latest/guides/fit_model.html)
Compare HRTF interpolation methods — evaluate template quality using a perceptually grounded metric. → [Guide](https://bayesian-listener.readthedocs.io/en/latest/guides/compare_interpolation.html)
---
Source code: github.com/robaru/bayesian_listener
Full documentation: bayesian-listener.readthedocs.io
