Sound Field Analysis toolbox for Python
The sound_field_analysis toolbox (short: sfa) is a Python port of the Sound Field Analysis Toolbox (SOFiA) toolbox, originally by Benjamin Bernschütz . The main goal of the sfa toolbox is to analyze, visualize and process sound field data recorded by spherical microphone arrays. Furthermore, various types of test-data may be generated to evaluate the implemented functions. It is an essential building block of ReTiSAR, an implementation of real time binaural rendering of spherical microphone array data.
We use Python 3.9 for development. Chances are that earlier version will work too but this is currently untested.
The following external libraries are required:
For performance and convenience reasons we highly recommend to use Conda (miniconda for simplicity) to manage your Python installation. Once installed, you can use the following steps to receive and use sfa, depending on your use case:
From PyPI /
pip:Install into an existing environment (without example Jupyter Notebooks):
pip install sound_field_analysis
By cloning (or downloading) the repository and setting up a new environment:
git clone https://github.com/AppliedAcousticsChalmers/sound_field_analysis-py.git
cd sound_field_analysis-py/Create a new Conda environment from the specified dependencies:
conda env create --file environment.yml --forceActivate the environment:
source activate sfaOptional: Install additional dependencies for development purposes (locally run Jupyter Notebooks with example, run tests, generate documentation):
conda env update --file environment_dev.yml
Note: Verify the version number of the documentation to see if it reflects the latest changes.
Exp1: Ideal plane wave
Ideal unity plane wave simulation and 3D plot.
Exp2: Measured plane wave
A measured plane wave from AZ=180°, EL=90° in the anechoic chamber using a cardioid mic.
Exp4: Binaural rendering
Render a spherical microphone array impulse response measurement binaurally. The example shows examples for loading miro or SOFA files.
- Update miro_to_struct() to work in modern Matlab versions
- Update MIRO struct loading for SphericalGrid (forgiving empty radius and quadrature weights)
- Add optional automatic limitation of y-axis range in plot2D()
- Implement frac_oct_smooth_fd() with fractional octave smoothing of magnitude spectra
- Add option for fractional octave smoothing of magnitude spectra to plot2D()
- Fix Exp4 to replace removed deg2rad and rad2deg utility functions
- Implement option to use real spherical harmonic basis functions
- Update Exp4 to optionally utilize real spherical harmonics
- Fix testing of spherical harmonics against reference Matlab implementation
- Add testing for generation of real spherical harmonics
- Add evaluation of performance for generation of complex and real spherical harmonics
- Add evaluation of performance for spatial sound field decomposition
- Remove deg2rad and rad2deg utility functions (replaced by NumPy equivalent)
- Update Conda environment setup to combine all development dependencies
- Update online and offline documentation
- Update MIRO struct loading for SphericalGrid (quadrature weights are now optional)
- Fix to prevent Python 3.8 syntax warnings
- Improve Exp4 (general code structure and utilizing Spherical Head Filter and Spherical Harmonics Tapering)
- Update README and PyPI package
- Update internal documentation and string formatting
- 2019-07-30 (v0.9)
- 2019-07-11 (v0.8)
- Implement Spherical Harmonics coefficients tapering
- Update Spherical Head Filter to consider tapering
- 2019-06-17 (v0.7)
- Implement Bandwidth Extension for Microphone Arrays (BEMA)
- Edit read_miro_struct(), named tuple ArraySignal and miro_to_struct.m to load center measurements
- 2019-06-11 (v0.6)
- Implement Radial Filter Improvement from Sound Field Analysis Toolbox (SOFiA) toolbox
- 2019-05-23 (v0.5)
- Implement Spherical Head Filter
- Implement Spherical Fourier Transform using pseudo-inverse
- Extract real time capable spatial Fourier transform
- Extract reversed m index function (Update Exp4)
See CONTRIBUTE.rst for full details.
This software is licensed under the MIT License (see LICENSE for full details).
The sound_field_analysis toolbox is based on the Matlab/C++ Sound Field Analysis Toolbox (SOFiA) toolbox by Benjamin Bernschütz. For more information you may refer to the original publication:
The Lebedev grid generation was adapted from an implementation by Richard P. Muller.