code: https://github.com/pmarmaroli/matlab-animation/blob/main/sound_source_localization_tdoa_two_mics.m
video: https://www.youtube.com/watch?v=gUbjNSG2UK4
This animation beautifully demonstrates the fundamental physics of sound waves and their detection, highlighting how differences in wave arrival times can be used for localization.
Key Physics Concepts
- Wave Propagation: the animation shows how sound waves travel through the air at a constant speed (343 m/s).
- Hyperbolic Localization: the green line represents a hyperbola, indicating all possible positions of the sound source based on the time difference of arrival (TDOA) at the two microphones.
- Triangulation: while two microphones can narrow down the source to a hyperbolic line, a third microphone would be needed to precisely locate the exact position.
code: https://github.com/pmarmaroli/matlab-animation/blob/main/time_delay_estimation_xcorr_vs_gccphat.m
video: https://youtu.be/wQo50Ot2UOw
This tutorial covers the implementation of the GCC-PHAT algorithm, adding noise, and creating an animated GIF to demonstrate the results.