Giter Club home page Giter Club logo

spectacoular's Introduction

Acoular Logo

PyPI PyPI Actions status DOI

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 sources 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 both our publication:

Sarradj, E., & Herold, G. (2017). 
A Python framework for microphone array data processing.
Applied Acoustics, 116, 50–58. 
https://doi.org/10.1016/j.apacoust.2016.09

and our software:

Sarradj, E., Herold, G., Kujawski, A., Jekosch, S., Pelling, A. J. R., Czuchaj, M., Gensch, T., & Oertwig, S..
Acoular – Acoustic testing and source mapping software. 
Zenodo. https://zenodo.org/doi/10.5281/zenodo.3690794

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, 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 environment 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 installation instructions, see the documentation.

Documentation and help

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

The Acoular blog contains some tutorials.

If you discover problems with the Acoular software, please report them using the issue tracker on GitHub. Please use the Acoular discussions forum for practical questions, discussions, and demos.

Contributing

We are always happy to welcome new contributors to the project. If you are interested in contributing, have a look at the CONTRIBUTING.md file.

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

spectacoular's People

Contributors

adku1173 avatar ahoelter avatar esarradj avatar gherold avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

spectacoular's Issues

Not compatible with bokeh >= 3.0.0

The new major release of the bokeh library (3.0.0) has brought some changes that break compatibility.
Release notes are here: https://docs.bokeh.org/en/latest/docs/releases.html
Migration guide here: https://github.com/bokeh/bokeh/wiki/Migration-Guides

I had a problem running the demos with the import of 'widgetbox' and 'Panel', because they weren't available in bokeh 3.0.0.
Since then, I downgraded to bokeh 2.4.3 and now I'm testing I can confirm that the interfaces start in the browser.

About an application bug

Hello, when I ran the example according to the manual, I found an error: in the application of "microphone array measurement app", the code in line 47 of main.py from spectral import rectgrid, calibhelper, filtoctavelive, timeinoutpresenter, filtoctave in filtoctave does not exist. Maybe you forgot to update the app when updating the version?

2021-10-16 03:48:28,725 Starting Bokeh server version 2.3.3 (running on Tornado 6.1)
2021-10-16 03:48:28,727 User authentication hooks NOT provided (default user enabled)
2021-10-16 03:48:28,733 Bokeh app running at: http://localhost:5006/Measurement_App
2021-10-16 03:48:28,733 Starting Bokeh server with process id: 324420
2021-10-16 03:48:33,230 Error running application handler <bokeh.application.handlers.directory.DirectoryHandler object at 0x0000021C51604250>: cannot import name 'FiltOctave' from 'spectacoular' (D:\Application\anaconda3\envs\spect
acoular\lib\site-packages\spectacoular\__init__.py)
File "main.py", line 47, in <module>:
from spectacoular import RectGrid,CalibHelper,FiltOctaveLive,TimeInOutPresenter,FiltOctave Traceback (most recent call last):
  File "D:\Application\anaconda3\envs\spectacoular\lib\site-packages\bokeh\application\handlers\code_runner.py", line 197, in run
    exec(self._code, module.__dict__)
  File "D:\Document\spectacoular\spectacoular-master\spectacoular-master\apps\Measurement_App\main.py", line 47, in <module>
    from spectacoular import RectGrid,CalibHelper,FiltOctaveLive,TimeInOutPresenter,FiltOctave
ImportError: cannot import name 'FiltOctave' from 'spectacoular' (D:\Application\anaconda3\envs\spectacoular\lib\site-packages\spectacoular\__init__.py)

2021-10-16 03:48:33,459 WebSocket connection opened
2021-10-16 03:48:33,461 ServerConnection created
2021-10-16 03:48:34,511 WebSocket connection closed: code=1001, reason=None```

UMA16SamplesGenerator not found in project

Hi everyone!
I've just tried start Measurement_App with my MiniDSP UMA16 mic array
Command from this file
bokeh serve --show Measurement_App --args --device=uma16 --blocksize=256

Log:
from acuma16 import UMA16SamplesGenerator ModuleNotFoundError: No module named 'acuma16'

I can't find any UMA16 modules in project
Any ideas?

pre-build interactive application running failed

I've tried to run MicGeomExample app but failed.
No errors from Spectacoular installation using "conda install -c acoular spectacoular" in pre-installed acoular22.3 conda environment (Python3.7).

1655280141(1)

Any hints? Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.