SoundLocalizer<T>

Models & Types · AiDotNet.Audio.Localization

Sound source localization using microphone arrays.

Implements: IDisposable

For Beginners

Sound localization finds where sounds come from:

  • Uses 2+ microphones to detect time differences in sound arrival
  • Calculates direction (azimuth/elevation) or 3D position of sound sources
  • Works like how human ears localize sounds

Usage:

How It Works

Estimates the direction of arrival (DOA) of sound sources using multiple microphones. Supports various algorithms: GCC-PHAT, MUSIC, SRP-PHAT.

Constructors

Constructor Summary
SoundLocalizer(double[] microphonePositions, SoundLocalizerOptions options) Creates a new SoundLocalizer with specified microphone positions.

Properties

Property Summary
double[] MicrophonePositions { get; } Gets the microphone positions (meters).
int NumMicrophones { get; } Gets the number of microphones in the array.

Methods

Method Summary
LocalizationResult Localize(Tensor<T>[] audioChannels) Localizes sound sources from multi-channel audio.
SoundLocalizer<T> CreateCircularArray(int numMicrophones, double radius, SoundLocalizerOptions options) Creates a SoundLocalizer for a circular microphone array.
SoundLocalizer<T> CreateLinearArray(int numMicrophones, double spacing, SoundLocalizerOptions options) Creates a SoundLocalizer for a linear microphone array.
Task<LocalizationResult> LocalizeAsync(Tensor<T>[] audioChannels, CancellationToken cancellationToken) Localizes sound sources asynchronously.
double EstimateTdoa(Tensor<T> channel1, Tensor<T> channel2) Estimates time difference of arrival (TDOA) between two channels.
void Dispose()