How aritrash/atd-sim works
ATD-Sim is a C++ terminal laboratory for acoustic time-difference-of-arrival localization. The user selects an audio source and configures a run; the documented workflow propagates the signal to a four-microphone array, estimates pairwise TDOAs, checks physical feasibility, solves for a source position, then validates against truth. An optional Monte Carlo campaign evaluates noisy trials separately. The TUI presents animated chamber, signal diagnostics, and results. README documents capabilities beyond the sampled implementation excerpts, so those links reflect the documented pipeline; detailed runtime dispatch is not fully verifiable here.
Main entry points: tui.cpp Terminal UI · tdoa_estimation.cpp GCC-PHAT TDOA · waveform.cpp Waveform loading · engine.cpp Acoustic propagation
Components 23
Inputs and setup
- File picker
src/platform/file_picker.cpp - Run configuration
src/core/configuration.cpp - Waveform loading
src/dsp/waveform.cpp
Acoustic processing
- Acoustic propagation
src/simulation/engine.cpp - Fourier transforms
src/dsp/fourier.cpp - GCC-PHAT TDOA
src/simulation/tdoa_estimation.cpp - Signal diagnostics
include/atdsim/simulation/diagnostics.hpp
Localization evaluation
- Physical feasibility
src/localization/gauss_newton.cpp - Spherical solver
src/localization/gauss_newton.cpp - Result validation
src/localization/localization.cpp - Monte Carlo
src/simulation/monte_carlo.cpp
Terminal experience
- Application entry
src/main.cpp - Terminal UI
src/presentation/tui.cpp - Animation engine
src/presentation/animation_engine.cpp - Acoustic chamber
src/presentation/acoustic_chamber.cpp - Scene rendering
src/presentation/geometry_scene.cpp - Pixel rendering
src/presentation/pixel_renderer.cpp - Results presentation
src/presentation/tui.cpp - Terminal capabilities
src/platform/terminal.cpp
Other components
- User
- Audio file
- Terminal
- ffprobe
Connections 33
- User → Application entry: starts
- Application entry → Terminal UI: launches
- User → Terminal UI: configures run
- Terminal UI → File picker: requests source
- Audio file → File picker: selects
- File picker → Waveform loading: provides path
- Waveform loading → Audio file: reads
- Waveform loading → ffprobe: probes MP3 metadata
- User → Run configuration: sets parameters
- Terminal UI → Run configuration: submits settings
- Terminal UI → Acoustic propagation: runs simulation
- Run configuration → Acoustic propagation: supplies geometry
- Waveform loading → GCC-PHAT TDOA: supplies samples
- Acoustic propagation → GCC-PHAT TDOA: supplies propagation context
- GCC-PHAT TDOA → Fourier transforms: computes correlations
- GCC-PHAT TDOA → Physical feasibility: provides measured TDOAs
- Physical feasibility → Spherical solver: passes valid pairs
- Spherical solver → Result validation: returns estimate
- Acoustic propagation → Result validation: provides ground truth
- GCC-PHAT TDOA → Monte Carlo: provides observed TDOAs
- Result validation → Monte Carlo: provides run outcome
- GCC-PHAT TDOA → Signal diagnostics: captures curves and envelopes
- Terminal UI → Animation engine: updates run display
- Signal diagnostics → Animation engine: injects diagnostics
- Animation engine → Acoustic chamber: renders state
- Acoustic chamber → Scene rendering: builds scene
- Scene rendering → Pixel rendering: draws pixels
- Terminal UI → Results presentation: presents outcome
- Result validation → Results presentation: supplies position and status
- Monte Carlo → Results presentation: supplies statistics
- Terminal UI → Terminal capabilities: detects capabilities
- Results presentation → Terminal: renders pages
- Acoustic chamber → Terminal: renders animation