Skip to main content

eXtensible Steered Response Power for Sound Source Localization

Project description

XSRP: eXtensible Steered Response Power

This repository contains the code for the paper:

Steered Response Power for Sound Source Localization: A Tutorial Review

GUI Demo

GUI Application

The repository includes a real-time GUI application for interactive sound source localization. The GUI provides:

  • Real-time polar visualization: Live polar plots showing SRP maps and detected source directions
  • Interactive controls: Adjustable parameters including smoothing speed, averaging samples, angular resolution, and SRP map sharpening
  • Bandpass filtering: Configurable high-pass and low-pass filters for preprocessing
  • SRP mode selection: Choose between time-domain and frequency-domain SRP-PHAT processing
  • Frequency weighting: Optional frequency-domain weighting methods (coherence, sparsity, PAR) for improved source detection
  • Noise floor calibration: Record and subtract ambient noise for improved source detection
  • Microphone configuration: Load microphone array configurations from YAML files
  • Exponential smoothing tracker: Temporal smoothing of DOA estimates to reduce jitter

To run the GUI:

# If installed via pip with GUI extras:
xsrp-gui

# Or during development:
uv run python -m xsrp.gui

The following functionality is currently implemented:

Core SRP Algorithms

  • Conventional SRP-PHAT in the time domain: Taking the DFT, applying the phase transform, followed by the IDFT as described by Dibiase et al. [1]
  • Conventional SRP-PHAT in the frequency domain: Same as above without the IDFT step, enabling per-frequency processing
  • SRP with temporal cross-correlation: Time-domain SRP using cross-correlation without phase transform
  • Multi-source SRP: Extension for localizing multiple simultaneous sound sources

Signal Processing Features

  • Parabolic interpolation: Fractional sample interpolation of the cross-correlation function for improved time resolution
  • Volumetric SRP: Projects the average of N-closest correlation values instead of only the one associated with the microphone pair's Time Difference of Arrival (TDOA), improving robustness
  • SRP map sharpening: Exponentiation of SRP maps to enhance peaks and suppress sidelobes
  • Bandpass filtering: Preprocessing with configurable high-pass and low-pass filters

Frequency-Domain Weighting Methods

Frequency-domain weighting methods for narrowband SRP maps (available in frequency-domain mode):

  • Coherence-based weighting: Weights frequencies by spatial coherence across microphone pairs (high coherence indicates real sources, low coherence indicates noise/sidelobes)
  • Sparsity-based weighting: Weights frequencies by the sparsity (Gini coefficient) of their SRP maps (sparse/peaked maps indicate real sources, diffuse maps indicate sidelobes)
  • Peak-to-Average Ratio (PAR): Weights frequencies by the ratio of peak to average SRP values (high PAR indicates dominant peaks)

Real-Time Processing

  • Streaming SRP: Frame-based processing for real-time audio streams
  • Exponential smoothing tracker: Temporal smoothing of SRP maps and DOA estimates to reduce jitter
  • Noise floor calibration: Automatic calibration and subtraction of noise floor SRP maps for improved source detection

Grid and Visualization

  • Grid creation functions: Support for Positional Source Localization (2D/3D Cartesian grids) and Direction of Arrival (DOA) Estimation (1D azimuth, 2D azimuth-elevation)
  • Visualization tools: Polar plots, cross-correlation visualizations, and SRP map comparisons

Installation

From PyPI

Install the core package:

pip install xsrp

Install with GUI support (includes PyQt5, matplotlib, pyaudio, etc.):

pip install xsrp[gui]

After installing with GUI support, you can run the GUI application:

xsrp-gui

Development Installation

We recommend using uv for dependency management. Change directory to the xsrp folder and run the following commands:

  1. Install uv (if not already installed): curl -LsSf https://astral.sh/uv/install.sh | sh
  2. Install dependencies: uv sync
  3. Activate the virtual environment: source .venv/bin/activate (or use uv run to run commands in the environment)

You can then optionally run the tests to verify that everything is working correctly:

  1. uv run pytest tests (or make test)

You may want to check the images that were generated in the tests/temp folder.

To run the GUI during development:

uv run python -m xsrp.gui

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xsrp-0.1.0.tar.gz (3.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xsrp-0.1.0-py3-none-any.whl (35.7 kB view details)

Uploaded Python 3

File details

Details for the file xsrp-0.1.0.tar.gz.

File metadata

  • Download URL: xsrp-0.1.0.tar.gz
  • Upload date:
  • Size: 3.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for xsrp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 21025815cff5477d38549107c05f116fab7a14ca72945e59db2816de6d60e3b4
MD5 9781aee84a89920dc831dfcab971ebcd
BLAKE2b-256 2245b2cdad122cae71f8807e9d21969bb9d9edc766803494251a9f94c9a27f68

See more details on using hashes here.

File details

Details for the file xsrp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: xsrp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 35.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for xsrp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fbfba9b800716f95d88faf27189d4f38428894e5a864a14e158e2e3869db9a86
MD5 e2c2bcc85018a7223de5b5af23d83db7
BLAKE2b-256 9853a159b4b72dd7290809f76633c760371de45e09c579aa9655b178aa4e512f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page