pyroomacoustics

repository·master·Indexed 23 days ago

https://github.com/lcav/pyroomacoustics

A Python framework for room acoustics and audio processing designed for the rapid development and testing of audio array processing algorithms. It provides tools for simulating 2D/3D convex and non-convex acoustic environments, room impulse response generation, and high-performance C++ implementations. Key modules include Direction of Arrival (DOA) estimation, Blind Source Separation (BSS), adaptive filtering, single-channel denoising, and a comprehensive materials database for absorption and scattering coefficients.

Tokens
21.9K
Snippets
33
Records
138
Agent score
83%

What's inside pyroomacoustics

  1. Overview of Pyroomacoustics submodules

    master

    The core functionality of Pyroomacoustics is exposed through several key submodules:

    • pyroomacoustics.acoustics: General acoustic primitives.
    • pyroomacoustics.beamforming: Beamforming algorithms and implementations.
    • pyroomacoustics.build_rir: Tools for building Room Impulse Responses (RIR).
    • pyroomacoustics.directivities: Microphone and source directivity models.
    • pyroomacoustics.metrics: Evaluation metrics for acoustic performance.
    • pyroomacoustics.multirate: Multirate signal processing.
    • pyroomacoustics.parameters: Configuration and parameter management.
    • pyroomacoustics.recognition: Sound/speech recognition related utilities.
    • pyroomacoustics.room: Room geometry and acoustic properties.
    • pyroomacoustics.simulation: Acoustic simulation engines.
    • pyroomacoustics.soundsource: Sound source modeling.
    • pyroomacoustics.stft: Short-Time Fourier Transform utilities.
    • pyroomacoustics.sync: Synchronization tools.
    • pyroomacoustics.utilities: General helper functions.
    • pyroomacoustics.windows: Window functions for signal processing.
  2. Overview of Pyroomacoustics subpackages

    master

    Pyroomacoustics is organized into several specialized subpackages for acoustic simulation and signal processing:

    • pyroomacoustics.adaptive: Adaptive filtering algorithms.
    • pyroomacoustics.bss: Blind Source Separation techniques.
    • pyroomacoustics.datasets: Tools for managing and loading acoustic datasets.
    • pyroomacoustics.denoise: Denoising algorithms.
    • pyroomacoustics.doa: Direction of Arrival estimation.
    • pyroomacoustics.experimental: Experimental features and algorithms.
    • pyroomacoustics.phase: Phase-related signal processing.
    • pyroomacoustics.random: Randomization tools for simulations.
    • pyroomacoustics.transform: Signal transformation utilities.
  3. Explore Direction of Arrival (DOA) algorithms in pyroomacoustics

    master

    The pyroomacoustics.doa module provides various algorithms for estimating the Direction of Arrival of sound sources. The available algorithms include:

    • cssm: Coherent Signal Subspace Method
    • frida: Frequency-domain Robust Iterative DOA Algorithm
    • music: Multiple Signal Classification
    • normmusic: Normalized MUSIC
    • srp: Steered Response Power
    • tops: Test of Orthogonality of Projected Subspaces
    • waves: Wave-based DOA estimation
  4. Explore the pyroomacoustics.simulation sub-package

    master

    The pyroomacoustics.simulation sub-package provides internal routines for simulating room acoustics. It is organized into several submodules, primarily focusing on:

    • pyroomacoustics.simulation.ism: Likely related to Image Source Method (ISM) simulations.
    • pyroomacoustics.simulation.rt: Likely related to Reverberation Time (RT) simulations.

    Users looking to perform advanced acoustic simulations should explore these specific submodules for specialized routines.

  5. Use DOA tools and helpers

    master

    The pyroomacoustics.doa module includes several utility tools and helpers for DOA estimation tasks, such as:

    • doa: General DOA estimation interface/tools
    • tools_fri_doa_plane: Tools for Frequency Response Iterative DOA in a plane
    • grid: Grid generation for spatial scanning
    • plotters: Visualization tools for DOA results
    • detect_peaks: Peak detection for identifying source directions
    • utils: General utility functions for DOA processing
  6. Explore available datasets in pyroomacoustics.datasets

    master

    The pyroomacoustics.datasets module provides wrappers for various speech and acoustic datasets. The following datasets are supported through specific submodules:

    • cmu_arctic: CMU Arctic speech corpus.
    • google_speech_commands: Google Speech Commands dataset.
    • sofa: Support for SOFA (Spatially Oriented Format for Acoustics) files.
    • timit: TIMIT acoustic-phonetic continuous speech corpus.

    Each dataset is accessed via its respective submodule within the pyroomacoustics.datasets namespace.

  7. Use single channel denoising algorithms in pyroomacoustics

    master

    The pyroomacoustics.denoise module provides several algorithms for single-channel denoising. You can use these algorithms to reduce noise from a single audio signal.

    Available algorithms include:

    • spectral_subtraction: Spectral subtraction based denoising.
    • subspace: Subspace-based denoising.
    • iterative_wiener: Iterative Wiener filter based denoising.

    Refer to the specific documentation for each algorithm to understand its parameters and implementation details.

  8. Explore Blind Source Separation (BSS) algorithms in pyroomacoustics

    master

    The pyroomacoustics.bss module provides various algorithms for Blind Source Separation. The available algorithms include:

    • auxiva: Auxiliary-function-based iterative watershed algorithm.
    • trinicon: A specific BSS algorithm implementation.
    • ilrma: Independent Low-Rank Matrix Analysis.
    • sparseauxiva: Sparse version of the AUXIVA algorithm.
    • fastmnmf: Fast Multichannel Non-negative Matrix Factorization.
    • fastmnmf2: An updated or alternative version of the Fast MNMF algorithm.

    Detailed documentation for each specific algorithm can be found in their respective submodules within the pyroomacoustics.bss package.

  9. Explore the Adaptive Filtering module

    master

    The pyroomacoustics.adaptive module provides implementations of various adaptive filtering algorithms and related utilities. It is organized into three main categories:

    1. Algorithms: Core adaptive filtering implementations including LMS (Least Mean Squares), RLS (Recursive Least Squares), and Subband LMS.
    2. Tools and Helpers: Utility functions and data structures designed to support adaptive filtering workflows.
    3. Adaptive Filter Interface: General adaptive filter abstractions.
  10. Explore pyroomacoustics.transform algorithms

    master

    The pyroomacoustics.transform module provides various signal transformation algorithms. Currently, the module includes implementations for:

    • DFT (Discrete Fourier Transform): Available via pyroomacoustics.transform.dft.
    • STFT (Short-Time Fourier Transform): Available via pyroomacoustics.transform.stft.

    These transforms are typically used to move signals between the time domain and the frequency domain for acoustic processing tasks.

  11. Explore the pyroomacoustics.experimental package submodules

    master

    The pyroomacoustics.experimental package contains several specialized submodules for advanced acoustic research and simulation tasks. Use these submodules to access experimental features that are not part of the core stable API.

    Available submodules include:

    • deconvolution: Tools for signal deconvolution.
    • delay_calibration: Methods for calibrating delays.
    • localization: Algorithms for sound source localization.
    • measure_ir: Functionality for measuring impulse responses.
    • physics: Physics-based acoustic modeling tools.
    • point_cloud: Support for point cloud data processing.
    • rt60: Tools for estimating reverberation time (RT60).
    • signals: Experimental signal processing utilities.
  12. How room acoustics simulation works in pyroomacoustics

    master

    The package uses an object-oriented approach to simulate acoustic environments. The core workflow involves:

    1. Creating a Room: Use the Room class to define the geometry (convex or non-convex, 2D or 3D).
    2. Adding Elements: Add Source objects (sound emitters) and MicrophoneArray objects to the room.
    3. RIR Generation: The room uses a C++ accelerated image source model or ray tracing to compute Room Impulse Responses (RIR) between sources and receivers.
    4. Signal Processing: The Room class can process sound samples emitted by sources, simulating propagation to the microphones. You can then use STFT engines or beamforming objects to process these signals.