Skip to main content

Python library for acoustic beamforming

Project description

Acoular Logo

PyPI PyPI Github

Acoular

Acoular is a Python module for acoustic beamforming that is distributed under the new BSD license.

It is aimed at applications in acoustic testing. Multichannel data recorded by a microphone array can be processed and analyzed in order to generate mappings of sound source distributions. The maps (acoustic photographs) can then be used to locate sources of interest and to characterize them using their spectra.

Features

  • frequency domain beamforming algorithms: delay & sum, Capon (adaptive), MUSIC, functional beamforming, eigenvalue beamforming
  • frequency domain deconvolution algorithms: DAMAS, DAMAS+, Clean, CleanSC, orthogonal deconvolution
  • frequency domain inverse methods: CMF (covariance matrix fitting), general inverse beamforming, SODIX
  • time domain methods: delay & sum beamforming, CleanT deconvolution
  • time domain methods applicable for moving source with arbitrary trajectory (linear, circular, arbitrarily 3D curved),
  • frequency domain methods for rotating sources via virtual array rotation for arbitrary arrays and with different interpolation techniques
  • 1D, 2D and 3D mapping grids for all methods
  • gridless option for orthogonal deconvolution
  • four different built-in steering vector formulations
  • arbitrary stationary background flow can be considered for all methods
  • efficient cross spectral matrix computation
  • flexible modular time domain processing: n-th octave band filters, fast, slow, and impulse weighting, A-, C-, and Z-weighting, filter bank, zero delay filters
  • time domain simulation of array microphone signals from fixed and arbitrarily moving sources in arbitrary flow
  • fully object-oriented interface
  • lazy evaluation: while processing blocks are set up at any time, (expensive) computations are only performed when needed
  • intelligent and transparent caching: computed results are automatically saved and loaded on the next run to avoid unnecessary re-computation
  • parallel (multithreaded) implementation with Numba for most algorithms
  • easily extendable with new algorithms

License

Acoular is licensed under the BSD 3-clause. See LICENSE

Citing

If you use Acoular for academic work, please consider citing our publication:

Ennes Sarradj, Gert Herold,
A Python framework for microphone array data processing,
Applied Acoustics, Volume 116, 2017, Pages 50-58

Dependencies

Acoular runs under Linux, Windows and MacOS and needs Numpy, Scipy, Traits, scikit-learn, pytables, Numba packages available. Matplotlib is needed for some of the examples.

If you want to use input from a soundcard hardware, you will also need to install the sounddevice package. Some solvers for the CMF method need Pylops.

Installation

Acoular can be installed via conda, which is also part of the Anaconda Python distribution. It is recommended to install into a dedicated conda environment. After activating this environment, run

conda install -c acoular acoular

This will install Acoular in your Anaconda Python enviroment and make the Acoular library available from Python. In addition, this will install all dependencies (those other packages mentioned above) if they are not already present on your system.

A second option is to install Acoular via pip. It is recommended to use a dedicated virtual environment and then run

pip install acoular

For more detailed install instructions see the documentation.

Documentation and help

Documentation is available here with a getting started section and examples.

The Acoular blog contains some tutorials.

Problems, suggestions and success using Acoular may be reported via the acoular-users discussion forum.

Example

This reads data from 64 microphone channels and computes a beamforming map for the 8kHz third octave band:

from os import path
import acoular
from matplotlib.pylab import figure, plot, axis, imshow, colorbar, show

# this file contains the microphone coordinates
micgeofile = path.join(path.split(acoular.__file__)[0],'xml','array_64.xml')
# set up object managing the microphone coordinates
mg = acoular.MicGeom( from_file=micgeofile )
# set up object managing the microphone array data (usually from measurement)
ts = acoular.TimeSamples( name='three_sources.h5' )
# set up object managing the cross spectral matrix computation
ps = acoular.PowerSpectra( time_data=ts, block_size=128, window='Hanning' )
# set up object managing the mapping grid
rg = acoular.RectGrid( x_min=-0.2, x_max=0.2, y_min=-0.2, y_max=0.2, z=0.3, \
increment=0.01 )
# set up steering vector, implicitely contains also the standard quiescent 
# environment with standard speed of sound
st = acoular.SteeringVector( grid = rg, mics=mg )
# set up the object managing the delay & sum beamformer
bb = acoular.BeamformerBase( freq_data=ps, steer=st )
# request the result in the 8kHz third octave band from approriate FFT-Lines
# this starts the actual computation (data intake, FFT, Welch CSM, beamforming)
pm = bb.synthetic( 8000, 3 )
# compute the sound pressure level
Lm = acoular.L_p( pm )
# plot the map
imshow( Lm.T, origin='lower', vmin=Lm.max()-10, extent=rg.extend(), \
interpolation='bicubic')
colorbar()

result

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

acoular-23.11.tar.gz (7.0 MB view details)

Uploaded Source

Built Distribution

acoular-23.11-py3-none-any.whl (772.6 kB view details)

Uploaded Python 3

File details

Details for the file acoular-23.11.tar.gz.

File metadata

  • Download URL: acoular-23.11.tar.gz
  • Upload date:
  • Size: 7.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for acoular-23.11.tar.gz
Algorithm Hash digest
SHA256 68257afed8ba2591cb65fecede08c3de45c42015685f4b4d7ee315e511e44191
MD5 f3e62888e5989972f34c77ea66963b56
BLAKE2b-256 d97122d13cb6274bb55d223676415677ee57505f3f1fb2ebca4b9d3fab1fd3e9

See more details on using hashes here.

File details

Details for the file acoular-23.11-py3-none-any.whl.

File metadata

  • Download URL: acoular-23.11-py3-none-any.whl
  • Upload date:
  • Size: 772.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.3

File hashes

Hashes for acoular-23.11-py3-none-any.whl
Algorithm Hash digest
SHA256 a9f4d24c2b9d67b61e2929a320dfd881cb1e529b59ae16e60d9446391c4f1cdc
MD5 c7a21c8a1d9556d3d124d142a2ce1740
BLAKE2b-256 974bc98b2bda5cc469d32471189ee828a322c210723b76d3c21ebee8cbd75af7

See more details on using hashes here.

Supported by

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