$ show LCAV/pyroomacoustics
Pyroomacoustics is a Python library for room acoustics simulation and audio array signal processing. It provides a modular framework for creating virtual acoustic environments (rooms with walls, materials, sources, and microphone arrays) and simulating room impulse responses using both image-source and ray-tracing methods, with a C++ backend for performance. Beyond simulation, it offers a comprehensive suite of audio processing algorithms: beamforming (delay-and-sum, MVDR, rake filters), direction-of-arrival estimation (MUSIC, SRP-PHAT, FRIDA, CSSM, TOPS, WAVES), blind source separation (AuxIVA, ILRMA, FastMNMF, TRINICON), adaptive filtering (NLMS, RLS, subband LMS), and noise reduction (spectral subtraction, subspace, iterative Wiener). It also includes directivity modeling (analytic patterns and measured SOFA data), STFT/DFT transforms with multiple backends, and utility modules for resampling, filterbanks, and metrics (RT60, PESQ). The library is designed for research prototyping and reproducible experiments, with extensive unit tests and CI/CD for multi-platform builds.
The LLM identified 5 files worth highlighting for reuse:
Abstract base class `Directivity` defining the interface for all directivity patterns (analytic or measured). It provides methods for evaluating the pattern at given directions, plotting, and energy distribution sampling for ray tracing. The design is clean and self-contained; another project could easily subclass it to define custom directivities without depending on the rest of pyroomacoustics.
A robust STFT analysis/synthesis class that handles overlapping windows, streaming, zero-padding, and supports multiple FFT backends (NumPy, PyFFTW, MKL). It provides both full-spectrum and half-spectrum modes, and includes convenience functions for one-shot processing. The backend abstraction and clean interface make it reusable in any audio processing pipeline.
Contains `projection_back` (least-squares decomposition of separated signals back to sensor domain) and `sparir` (sparse approximation via iterative reweighting). These are reusable building blocks for BSS algorithms; they are self-contained and algorithm-agnostic.
Implements rejection sampling for arbitrary probability density functions on the sphere, with a precomputed envelope using maximum likelihood. Also includes `robust_spherical_voronoi_areas` for computing Voronoi cell areas on the sphere. These are non-trivial numerical routines extractable for any sampling need on spherical domains.
Provides `GridCircle`, `GridSphere`, and `DetectPeaks` for uniform sampling of directions (2D/3D) and local peak detection on the grid. The separation of grid generation from peak detection is a reusable pattern for any DOA or spatial estimation algorithm that needs to search over a discrete set of directions.