Direction of Arrival

Module contents

Direction of Arrival Finding

This sub-package provides implementations of popular direction of arrival findings algorithms.

MUSIC
Multiple Signal Classification [1]
NormMUSIC
MUSIC with frequency normalization [2]
SRP-PHAT
Steered Response Power – Phase Transform [3]
CSSM
Coherent Signal Subspace Method [4]
WAVES
Weighted Average of Signal Subspaces [5]
TOPS
Test of Orthogonality of Projected Subspaces [6]
FRIDA
Finite Rate of Innovation Direction of Arrival [7]

All these classes derive from the abstract base class pyroomacoustics.doa.doa.DOA that offers generic methods for finding and visualizing the locations of acoustic sources.

The constructor can be called once to build the DOA finding object. Then, the method pyroomacoustics.doa.doa.DOA.locate_sources performs DOA finding based on time-frequency passed to it as an argument. Extra arguments can be supplied to indicate which frequency bands should be used for localization.

How to use the DOA module

Here R is a 2xQ ndarray that contains the locations of the Q microphones in the columns, fs is the sampling frequency of the input signal, and nfft the length of the FFT used.

The STFT snapshots are passed to the localization methods in the X ndarray of shape Q x (nfft // 2 + 1) x n_snapshots, where n_snapshots is the number of STFT frames to use for the localization. The option freq_bins can be provided to specify which frequency bins to use for the localization.

>>> doa = pyroomacoustics.doa.MUSIC(R, fs, nfft)
>>> doa.locate_sources(X, freq_bins=np.arange(20, 40))

Other Available Subpackages

pyroomacoustics.doa.grid

this provides abstractions for computing functions on regular or irregular grids defined on circles and spheres with peak finding methods

pyroomacoustics.doa.plotters

a few methods to plot functions and points on circles or spheres

pyroomacoustics.doa.detect_peaks

1D peak detection routine from Marcos Duarte

pyroomacoustics.doa.tools_frid_doa_plane

routines implementing FRIDA algorithm

Utilities

pyroomacoustics.doa.algorithms

a dictionary containing all the DOA object subclasses availables indexed by keys ['MUSIC', 'NormMUSIC', 'SRP', 'CSSM', 'WAVES', 'TOPS', 'FRIDA']

Note on MUSIC

Since NormMUSIC has a more robust performance, we recommend to use NormMUSIC over MUSIC. When MUSIC is used as a baseline for publications, we recommend to use both NormMUSIC and MUSIC. For more information, you may have a look at our jupyter notebook at https://github.com/LCAV/pyroomacoustics/tree/master/notebooks/norm_music_demo.ipynb

References

Algorithms

Tools and Helpers