Source-linked AI summary

Pyroomacoustics: A Python package for audio room simulations and array processing algorithms

Robin Scheibler, Eric Bezzam, Ivan Dokmanić

arXiv:1710.04196v1cs.SDeess.AS

TL;DR

Audio array algorithm evaluation is slowed by the effort required to build realistic simulation scenarios and reimplement competing methods. Pyroomacoustics addresses this with a Python object-oriented interface, image-source-based room simulation, reference algorithms, and an STFT engine. The resulting toolset is presented as a starting point for rapidly prototyping and evaluating new audio processing algorithms, while current scope excludes source and microphone directivity and makes intricate non-convex 3D room construction awkward.

  • Problem

    Evaluating audio array algorithms requires realistic scenarios and competing implementations, but physical experiments and reimplementation are time-consuming.

  • Method

    Pyroomacoustics combines a Python object-oriented simulation API, an image-source-based RIR generator, reference implementations, and an STFT engine.

  • Results

    The package provides a comprehensive set of tools for rapidly prototyping and evaluating new audio processing algorithms.

  • Takeaways & Limitations

    Pyroomacoustics is a practical starting point for audio processing algorithm development and evaluation.

  • Takeaways & Limitations

    The current version supports only omnidirectional sources and microphones, and intricate non-convex 3D room geometries are awkward to define.

Abstract

from arXiv · show

We present pyroomacoustics, a software package aimed at the rapid development and testing of audio array processing algorithms. The content of the package can be divided into three main components: an intuitive Python object-oriented interface to quickly construct different simulation scenarios involving multiple sound sources and microphones in 2D and 3D rooms; a fast C implementation of the image source model for general polyhedral rooms to efficiently generate room impulse responses and simulate the propagation between sources and receivers; and finally, reference implementations of popular algorithms for beamforming, direction finding, and adaptive filtering. Together, they form a package with the potential to speed up the time to market of new algorithms by significantly reducing the implementation overhead in the performance evaluation step.

1. INTRODUCTION

Pyroomacoustics addresses the need for rapid, reproducible evaluation of audio array algorithms by combining Python-based scenario construction, room-acoustic simulation, and algorithm implementations. It uses the image source model for practical room simulation and packages these capabilities in an open-source Python framework.

  • Motivation: Real-world array experiments provide controlled evaluation but limit replication and scenario exploration because setup and calibration are time-consuming.Numerical simulation enables rapid iteration and parameter tuning before physical experiments.
  • Motivation: Python offers a readable, extensible, free, and open-source alternative to MATLAB, supported by NumPy, SciPy, and scientific software infrastructure.The paper also notes Python’s adoption in machine learning and speech recognition.
  • Room simulation: The image source model represents wall reflections with virtual sources and constructs room impulse responses from their delays and attenuations.Its simplicity is useful, although accuracy depends on assumptions about wavelength and wall absorption.
  • Contribution: Pyroomacoustics provides a Python package for audio simulation with a fast image-source-based RIR generator and reference implementations for beamforming, DOA finding, and adaptive filtering.An STFT engine supports efficient frequency-domain processing through the package’s object-oriented interface.
  • Contribution: The package is distributed as open-source software through the standard Python package manager and GitHub.The introduction presents this availability as part of the package’s reproducibility-oriented positioning.

2. PYROOMACOUSTICS CORE

The core API models rooms, sources, microphone arrays, and beamformers as composable Python objects. It builds microphone signals through image-source-based RIR generation and supports both frequency- and time-domain processing, including frame-based STFT workflows.

  • Core API: A simulation scenario defines a room, attaches sound sources and a microphone array, generates image sources and RIRs, then convolves source audio with the appropriate RIRs.The core classes are Room, SoundSource, and MicrophoneArray.
  • Room: Room objects support 2D polygonal rooms and 3D polyhedral rooms, with extrusion available for lifting a 2D room into 3D.In 3D, walls are polygons defined by coplanar points.
  • SoundSource: SoundSource objects store real and image-source locations and can build RIRs or select subsets of image sources through an overloaded bracket operator.This supports scenarios such as room inference and acoustic rake receivers.
  • MicrophoneArray: MicrophoneArray stores microphone locations and sampling frequency, while its record method wraps rate conversion when simulation and microphone rates differ.Beamformer inherits from MicrophoneArray and adds beamforming weights or filters.
  • STFT and beamforming: The STFT engine supports configurable FFT size, zero-padding, windows, overlap-add analysis and synthesis, and frequency-domain processing.Efficient FFT libraries can be used, while direct time-domain filtering and weight-to-filter conversion are also available.

3. ROOM IMPULSE RESPONSE GENERATOR

The RIR generator applies the image source model to rectangular and arbitrary polyhedral rooms. It determines image-source visibility from each microphone and then constructs sampled impulse responses using distance, reflection order, absorption, sound speed, and a windowed-sinc function.

  • Image source generation: The generator handles rectangular rooms with polynomial image-source growth and arbitrary polyhedral rooms with exponential growth and visibility checks.Obtuse angles and re-entrant walls can make image sources invisible from parts of the room.
  • RIR construction: RIR construction uses the visible image sources associated with each microphone and real source.The resulting impulse response is sampled at the specified sampling frequency.
  • RIR construction: The RIR expression uses reflection order, wall absorption, sound speed, source-receiver distance, and a windowed-sinc function.The prose defines gen(s), α, c, and δLP as the reflection order, absorption factor, sound speed, and windowed-sinc function.
  • RIR construction: The window parameter Tw controls the approximation to a full sinc, and the implementation can assign different absorption factors to individual walls.The derivation discussion assumes identical absorption for simplicity but supports wall-specific values.

4. REFERENCE IMPLEMENTATIONS

Pyroomacoustics supplies reference implementations for common beamforming, direction-finding, and adaptive-filtering algorithms, alongside STFT support for frame-based processing. These components reduce the implementation burden of evaluating new audio processing methods.

  • Reference algorithms: Reference implementations address the time-consuming task of re-implementing competing algorithms for comparisons and benchmarks.The paper emphasizes robust, tested implementations as a way to reduce implementation overhead.
  • Beamforming: Beamforming supports frequency- and time-domain methods, including DS and MVDR, with far- and near-field formulations and interferer cancellation options.TRINICON blind source separation is also included.
  • Direction finding: The DOA interface accepts at least one frequency-domain frame and includes MUSIC and SRP-PHAT among its direction-finding algorithms.The supplied passage introduces the common API and several implemented methods.
  • Adaptive filtering: The adaptive-filter base interface updates estimates from new input and reference samples, with LMS, NLMS, and RLS implementations.Algorithm-specific options are passed through the constructor.
  • STFT processing: The STFT class provides analysis and synthesis for frame-based processing and supports efficient FFT libraries for real-time use cases.The Beamformer’s one-shot STFT processing is not suitable for streaming or real-time data sources.

5. CONCLUSION

pyroomacoustics combines room simulation, signal-processing tools, and reference implementations to support rapid prototyping and evaluation of audio algorithms. The package remains limited by awkward intricate-room definition and currently supports only omnidirectional sources and microphones.

  • Conclusion: Pyroomacoustics provides an intuitive API, an ISM-based room simulator, reference implementations, and a full STFT engine for audio processing.Its tools cover beamforming, direction-of-arrival finding, adaptive filtering, and frame-based processing.
  • Conclusion: The package is designed as a starting point for rapidly prototyping and evaluating new audio processing algorithms.
  • Examples: Figure 4 demonstrates non-convex-room image sources, generated room impulse responses, and Python code for reproducing the example.
  • Examples: Figure 5 illustrates circular delay-and-sum beamformer beampatterns at 2, 4, and 8 kHz alongside the generating code.
  • Limitations: Defining intricate room geometries, especially non-convex 3D rooms, is currently awkward.Proposed extensions include polygon and polyhedron set operations or parsers for conventional CAD files.
Loading 1710.04196v1…