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¶
- DOA (Base)
- Tools for FRIDA (azimuth only)
Rmtx_ri()
Rmtx_ri_half()
Rmtx_ri_half_out_half()
Tmtx_ri()
Tmtx_ri_half()
Tmtx_ri_half_out_half()
build_mtx_amp()
build_mtx_amp_ri()
build_mtx_raw_amp()
coef_expan_mtx()
compute_b()
compute_mtx_obj()
compute_obj_val()
cov_mtx_est()
cpx_mtx2real()
dirac_recon_ri()
dirac_recon_ri_half()
dirac_recon_ri_half_multiband()
dirac_recon_ri_half_multiband_lu()
dirac_recon_ri_half_multiband_parallel()
dirac_recon_ri_half_parallel()
dirac_recon_ri_inner()
dirac_recon_ri_multiband_inner()
extract_off_diag()
hermitian_expan()
lu_compute_mtx_obj()
lu_compute_mtx_obj_initial()
make_G()
make_GtG_and_inv()
mtx_freq2raw()
mtx_freq2visi()
mtx_fri2signal_ri()
mtx_fri2signal_ri_multiband()
mtx_updated_G()
mtx_updated_G_multiband()
mtx_updated_G_multiband_new()
multiband_cov_mtx_est()
multiband_extract_off_diag()
output_shrink()
polar2cart()
pt_src_recon()
pt_src_recon_multiband()
pt_src_recon_rotate()
- Grid Objects
- Plot Helpers
- Peak Detection
- DOA Utilities