|icon_awesome| |icon_travis| |icon_appveyor|
.. |icon_awesome| image:: https://awesome.re/mentioned-badge.svg :alt: Mentioned in Awesome Python for Scientific Audio :target: https://github.com/faroit/awesome-python-scientific-audio .. |icon_travis| image:: https://api.travis-ci.org/QULab/sound_field_analysis-py.svg .. |icon_appveyor| image:: https://ci.appveyor.com/api/projects/status/u0koxo5vcitmbghc?svg=true
.. sphinx-include-start-1
The sound_field_analysis toolbox (short: sfa) is a Python port of the Sound Field Analysis Toolbox (SOFiA) toolbox
, originally by Benjamin Bernschütz [1]
. 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 <https://github.com/AppliedAcousticsChalmers/ReTiSAR>
_, an implementation of real time binaural rendering of spherical microphone array data.
We use Python 3.9 <https://www.python.org/downloads/>
_ for development. Chances are that earlier version will work too but this is currently untested.
The following external libraries are required:
NumPy
_SciPy <https://www.scipy.org>
_Pysofaconventions <https://github.com/andresperezlopez/pysofaconventions>
_Jupyter
_ (for running Notebooks locally)Plotly <https://plot.ly/python/>
_ (for plotting)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 --force
| Activate the environment:
| source activate sfa
| Optional: Install additional dependencies for development purposes (locally run Jupyter
_ Notebooks with example, run tests, generate documentation):
| conda env update --file environment_dev.yml
.. C. From conda-forge <https://conda-forge.github.io>
_ channel: [outdated]
| Install into an existing environment:
| ``conda install -c conda-forge sound_field_analysis``
https://appliedacousticschalmers.github.io/sound_field_analysis-py/ and offline as PDF <DOCUMENTATION.pdf>
_.
Note: Verify the version number of the documentation to see if it reflects the latest changes <#version-history>
_.
The following examples are available as Jupyter
Notebooks, either statically on GitHub <examples/>
or interactively on nbviewer <https://nbviewer.jupyter.org/github/AppliedAcousticsChalmers/sound_field_analysis-py/tree/main/examples/>
_. You can of course also simply download the examples and run them locally!
Exp1: Ideal plane wave ^^^^^^^^^^^^^^^^^^^^^^
Ideal unity plane wave simulation and 3D plot.
View interactively on nbviewer <https://nbviewer.jupyter.org/github/AppliedAcousticsChalmers/sound_field_analysis-py/blob/main/examples/Exp1_IdealPlaneWave.ipynb>
__
.. sphinx-include-end-1
|AE1img|
.. |AE1_img| image:: examples/img/AE1_shape.png?raw=true .. _AE1_img: https://nbviewer.jupyter.org/github/AppliedAcousticsChalmers/sound_field_analysis-py/blob/main/examples/Exp1_IdealPlaneWave.ipynb
.. sphinx-include-start-2
Exp2: Measured plane wave ^^^^^^^^^^^^^^^^^^^^^^^^^
A measured plane wave from AZ=180°, EL=90° in the anechoic chamber using a cardioid mic.
View interactively on nbviewer <https://nbviewer.jupyter.org/github/AppliedAcousticsChalmers/sound_field_analysis-py/blob/main/examples/Exp2_MeasuredWave.ipynb>
__
.. sphinx-include-end-2
|AE2img|
.. |AE2_img| image:: examples/img/AE2_shape.png?raw=true .. _AE2_img: https://nbviewer.jupyter.org/github/AppliedAcousticsChalmers/sound_field_analysis-py/blob/main/examples/Exp2_MeasuredWave.ipynb
.. sphinx-include-start-3
Exp4: Binaural rendering ^^^^^^^^^^^^^^^^^^^^^^^^
Render a spherical microphone array impulse response measurement binaurally. The example shows examples for loading miro or SOFA
_ files.
View interactively on nbviewer <https://nbviewer.jupyter.org/github/AppliedAcousticsChalmers/sound_field_analysis-py/blob/main/examples/Exp4_BinauralRendering.ipynb>
__
.. sphinx-include-end-3
|AE4img|
.. |AE4_img| image:: examples/img/AE4_radial_filters.png?raw=true .. _AE4_img: https://nbviewer.jupyter.org/github/AppliedAcousticsChalmers/sound_field_analysis-py/blob/main/examples/Exp4_BinauralRendering.ipynb
.. sphinx-include-start-4
v2022.12.29
NumPy >= 1.24.0 <https://numpy.org/doc/stable//release/1.24.0-notes.html>
(replace all int
and np.int
with `np.int`)read_miro_struct()
to give warnings in case elevation data is foundv2022.1.10
miro_to_struct()
to work in modern Matlab versionsSphericalGrid
(forgiving empty radius and quadrature weights)plot2D()
frac_oct_smooth_fd()
with fractional octave smoothing of magnitude spectraplot2D()
deg2rad
and rad2deg
utility functionsv2021.2.4
deg2rad
and rad2deg
utility functions (replaced by NumPy
_ equivalent)Conda
_ environment setup to combine all development dependenciesonline <https://appliedacousticschalmers.github.io/sound_field_analysis-py/>
and offline <DOCUMENTATION.pdf>
documentationv2021.1.12
SphericalGrid
(quadrature weights are now optional)v2020.1.30
PyPI
_ packagev2019.11.6
v2019.8.15
read_SOFA_file()
write_SSR_IRs()
Conda
environment setup for Jupyter
Notebooksmiro_to_struct()
2019-07-30 (v0.9)
SOFA
_ importSOFA
_ importHRIRSignal
cart2sph()
and sph2cart()
utility functionsConda
_ environment file for convenient installation of required packages2019-07-11 (v0.8)
2019-06-17 (v0.7)
read_miro_struct()
, named tuple ArraySignal
and miro_to_struct.m
to load center measurements2019-06-11 (v0.6)
Sound Field Analysis Toolbox (SOFiA) toolbox
_2019-05-23 (v0.5)
See CONTRIBUTE.rst <CONTRIBUTE.rst>
_ for full details.
This software is licensed under the MIT License (see LICENSE <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:
[1] Bernschütz, B., Pörschmann, C., Spors, S., and Weinzierl, S. (2011). SOFiA Sound Field Analysis Toolbox. Proceedings of the ICSA International Conference on Spatial Audio <https://spatialaudio.net/sofia-sound-field-analysis-toolbox-2/>
_
The Lebedev grid generation was adapted from an implementation by Richard P. Muller <https://github.com/gabrielelanaro/pyquante/blob/master/Data/lebedev_write.py>
_.
.. _Sound Field Analysis Toolbox (SOFiA) toolbox: https://audiogroup.web.th-koeln.de/SOFiA_wiki/WELCOME.html .. _[1]: #references .. _PyPI: https://pypi.org/project/sound-field-analysis/ .. _NumPy: https://www.numpy.org/ .. _Jupyter: https://jupyter.org/ .. _Conda: https://conda.io/en/master/miniconda.html .. SOFA: https://www.sofaconventions.org/mediawiki/index.php/SOFA(Spatially_Oriented_Format_for_Acoustics)