Skip to main content

Analyze, visualize and process sound field data recorded by spherical microphone arrays.

Project description

https://api.travis-ci.org/QULab/sound_field_analysis-py.svg https://ci.appveyor.com/api/projects/status/u0koxo5vcitmbghc?svg=true

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, an implementation of real time binaural rendering of spherical microphone array data.

Requirements

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:

Installation

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

Examples

The following examples are available as Jupyter Notebooks, either statically on GitHub or interactively on nbviewer. 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

AE1_img

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

AE2_img

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

AE4_img

Version history

v2021.2.4
  • 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

  • Update Conda environment setup to combine all development dependencies

  • Update online and offline documentation

v2021.1.12
  • Update MIRO struct loading (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)

v2020.1.30
  • Update README and PyPI package

v2019.11.6
  • Update internal documentation and string formatting

v2019.8.15
  • Change version number scheme to CalVer

  • Improve Exp4

  • Update read_SOFA_file()

  • Update 2D plotting functions

  • Improve write_SSR_IRs()

  • Improve Conda environment setup for Jupyter Notebooks

  • Update miro_to_struct()

2019-07-30 (v0.9)
  • Implement SOFA import

  • Update Exp4 to contain SOFA import

  • Delete obsolete Exp3

  • Add named tuple HRIRSignal

  • Implement cart2sph() and sph2cart() utility functions

  • Add Conda environment file for convenient installation of required packages

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)
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)

Contribute

See CONTRIBUTE.rst for full details.

You can find the full offline documentation as PDF as well as online at https://appliedacousticschalmers.github.io/sound_field_analysis-py/ .

License

This software is licensed under the MIT License (see LICENSE for full details).

References

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

The Lebedev grid generation was adapted from an implementation by Richard P. Muller.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sound_field_analysis-2021.2.4.tar.gz (48.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sound_field_analysis-2021.2.4-py3-none-any.whl (41.7 kB view details)

Uploaded Python 3

File details

Details for the file sound_field_analysis-2021.2.4.tar.gz.

File metadata

  • Download URL: sound_field_analysis-2021.2.4.tar.gz
  • Upload date:
  • Size: 48.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.24.0 setuptools/54.1.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for sound_field_analysis-2021.2.4.tar.gz
Algorithm Hash digest
SHA256 8b48737ac254eb684a51f52bc542a38e2d862477b69c3430b66f8fc5dcbe6c2a
MD5 905782fb02a5982bb09f88b21bafbef7
BLAKE2b-256 7075a0e96277002a58457ea988d9dba190b6059eeb36983c21b5696ac8bcec2d

See more details on using hashes here.

File details

Details for the file sound_field_analysis-2021.2.4-py3-none-any.whl.

File metadata

  • Download URL: sound_field_analysis-2021.2.4-py3-none-any.whl
  • Upload date:
  • Size: 41.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.24.0 setuptools/54.1.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for sound_field_analysis-2021.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 966082d32e2e24c532cedef79b5fb271bc1bedf4cc10df6dd7bf15f517d23b3d
MD5 8fda0a44a3b882954304c573d21b9cba
BLAKE2b-256 cebb6d052aaa17faf1ab1b5e80ca1f03ba43169d50b7ddbfde384985eff5098f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page