Skip to content

MATLAB code for the binaural rendering of baffled microphone arrays

License

Notifications You must be signed in to change notification settings

HaHeho/baffled-arrays-to-binaural

Repository files navigation

Binaural Rendering of Baffled Microphone Arrays

This repository contains MATLAB code for the binaural rendering of spherical microphone arrays (SMAs), equatorial microphone arrays (EMAs), and non-spherical microphone arrays (XMAs).

This version of the code (release v2024.JAES) was utilized in the manuscript

TODO_CITATION
[TODO_pdf] [audio examples] [data] [experiment resources]

  • README

  • Download

  • Clone
    git clone --recurse-submodules https://github.com/HaHeho/baffled-arrays-to-binaural.git --branch v2024.JAES
    

An older version of the code (release v2023.DAGA) was utilized in the manuscript

H. Helmholz, T. Deppisch, and J. Ahrens, “End-to-End Magnitude Least Squares Binaural Rendering for Equatorial Microphone Arrays,” in Fortschritte der Akustik -- DAGA 2023, 2023, pp. 1679–1682.
[pdf] [audio examples]

  • README

  • Download

  • Clone
    git clone --recurse-submodules https://github.com/HaHeho/baffled-arrays-to-binaural.git --branch v2023.DAGA
    

Setup

Clone the repository locally. Make sure to include the submodules with

git clone --recurse-submodules https://github.com/HaHeho/baffled-arrays-to-binaural.git

Alternatively, download the code and manually add the following additional tools to the dependencies/ folder:


Retrieve the following additional dependencies via the MATLAB Add-Ons menu or from Mathworks File Exchange:

Furthermore, manually add the necessary acoustic impulse responses (external source files are subject to their corresponding licenses) to the project structure:

Usage

Script x4_Preprocess_HRTFs.m:

  • Pre-process an HRTF data set in various ways before employing it for binaural rendering. At this point, we utilize a spatially subsampled set of the published HRTF to lower computation resources for all binaural renderings without losing spatial resolution.
  • The HRTFs are circ-shifted so that the signals start with the lowest energy sample out of all incidence directions and both ears. The data is then time-windowed to fade the start and the end of the HRTFs to further limit artifacts from time discontinuities. The resulting data set is exported with the suffix _adjusted, then utilized in the remainder of the binaural rendering.
  • Additional versions of the data set are exported employing direction-independent equalizations by the HRTFs diffuse-field response (suffix _diffuse), by the former superimposed with the Harman curve (suffix _harman), and by the diffuse-field response of another measurement of the same HRTF (suffix _reference). Thereby, respective minimum-phase and linear-phase variants of the generated equalization filters are exported as impulse responses and plotted.

Script x5_Render_Arrays.m:

  • Perform binaural rendering of SMA, EMA and XMA impulse response data sets at a specified spherical harmonics order and with a desired HRTF set.
  • Thereby, a reference binaural room impulse response data set (either from a dummy head measurement or from a former high-resolution array rendering) can be specified. The reference data is compared against the currently rendered binaural ear signals by generating extensive plots to evaluate time domain and frequency domain differences individually at all rendered head orientations.

Script x5a_Render_Arrays_Batch.m:

  • Consecutively perform an arbitrary combination of binaural renderings from microphone array impulse responses and varying parameter sets.

Script x5b_Compare_Rendering_Differences.m:

  • Compare arbitrary combinations of (rendered) binaural room impulse responses by plotting various time domain and averaged frequency domain representations. This is helpful for directly comparing similar rendering configurations and validating the rendering method or detecting potentially flawed data sets.

Script x5c_Compare_Rendering_Levels.m:

  • Compare arbitrary combinations of (rendered) binaural room impulse responses by plotting various resulting signal levels. This is helpful for the preparation of the rendered BRIRs for the perceptual comparison in a user study, where all stimuli should ideally be loudness normalized.

Script x5d_Compare_Rendering_EDC.m:

  • Generate an interactive plot to compare arbitrary combinations of (rendered) binaural room impulse responses by their Energy Decay Curve. This is helpful for directly comparing similar rendering configurations and validating the rendering method or detecting potentially flawed data sets.

Script x5e_Compare_Rendering_Azimuths.m:

  • Generate an interactive plot to compare arbitrary combinations of rendered binaural room impulse responses by their azimuth alignment angle applied during binaural rendering. This is helpful for directly comparing similar rendering configurations and validating the rendering method or detecting potentially flawed data sets.

Contributing

See CONTRIBUTING and CODE_OF_CONDUCT for full details.

Acknowledgment

We thank Reality Labs Research by Meta for funding this project.

License

This software is licensed under a Non-Commercial Software License (see LICENSE for full details).

About

MATLAB code for the binaural rendering of baffled microphone arrays

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Languages