Packages and tools

Installable software meant to be reused in your own projects.

Bayesian Listener

PyPI version Python versions GitHub stars License Documentation

Tired of running experiments with real listeners? bayesian_listener simulates their behaviour in a sound-localisation task with a Bayesian model that reproduces human directional localisation performance. Given an individual’s head-related transfer functions (HRTFs) and a binaural sound, it predicts full response distributions over all source directions, accounting for spectral, binaural and motor-noise uncertainty.

The package also exposes an explicit likelihood function, so listener-specific noise parameters can be estimated from measured pointing data by maximum likelihood, and competing spatial features or HRTF processing methods can be compared with principled model comparison.

Full-sphere posterior distribution predicted by the Bayesian Listener

Full-sphere response distribution predicted by the model.

What you can do

  • Fit localisation behaviour from behavioural data.

  • Recover and validate model parameters with maximum-likelihood estimation.

  • Compare HRTF interpolation methods quantitatively.

  • Generate synthetic responses for validation and analysis.

  • Run fast thanks to just-in-time compilation with numba.

Install

pip install bayesian_listener

Requires Python 3.10 or later.

Links

sofamyroom

GitHub stars License Last commit arXiv preprint

A fast, accurate and flexible “shoebox” room-acoustics simulator supporting both specular and diffuse reflections. It extends Roomsim by Schimmel et al. with the rendering of binaural room impulse responses (BRIRs) using arbitrary HRTFs stored in the AES Spatially Oriented Format for Acoustics (SOFA), read through libmysofa. Results are exported to WAVE files, and the simulator runs directly from the console or from MATLAB.

Through the Virtual Acoustic Space Traveling (VAST) framework it can systematically generate labelled datasets to train and test machine-learning algorithms for binaural audio. Developed with Daniele Bianchi.

Structure of the sofamyroom simulator

How sofamyroom combines the room simulation with a SOFA HRTF set.

Features

  • Load individual HRTF datasets in SOFA format.

  • Specular and diffuse reflections in a configurable shoebox room.

  • Command-line tool and MATLAB MEX interface.

  • Dataset generation for machine learning (VAST).

Build

The third-party code (libmysofa, PocketFFT, SFMT) is bundled; the only system dependency is zlib. Only 64-bit platforms are supported.

git clone https://github.com/robaru/sofamyroom.git
cd sofamyroom
cmake -S . -B build/cmake && cmake --build build/cmake
build/cmake/sofamyroom data/sampleroomsetup.txt

Note

In October 2026 the git history was rewritten to merge the old repositories into a single line. If you cloned sofamyroom before, please re-clone it.

Links

matlab_delsys_extractor

Last commit MATLAB

A MATLAB function, extract_delsys_data, that simplifies data exported from the Delsys Trigno Wireless EMG system through the Delsys File Utility. It extracts selected channels and fields from the nested export structure, resamples sensors recorded at different rates to a common rate, and can plot the result.

names = {
    'muscle1', 'emg', 500;  % EMG from channel muscle1, resampled to 500 Hz
    'hand2',   'acc', 50    % accelerometer from hand2, resampled to 50 Hz
};
datastreams = extract_delsys_data('data.mat', names, 1, 1);