Add ILD-based distance estimation + proximity zones

Computes Interaural Level Difference (dB) from left/right ear energy.
Fuses with triangulated distance (70/30 weight) for more robust estimate.
Classifies into proximity zones: intimate (<0.5m), conversational (0.5-2m),
across_room (2-5m), far (>5m).

ILD→distance mapping is empirical and should be calibrated per install.
Gaze vertical component now responds to proximity (closer = eyes down).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Alex
2026-04-12 21:12:00 -05:00
parent 88fb18800c
commit 2a25db8498
2 changed files with 81 additions and 8 deletions

View File

@@ -423,8 +423,10 @@ def doa_track_loop():
try:
state.doa = xvf_manager.read_both_doa()
if spatial_tracker:
result = spatial_tracker.update(state.doa)
if spatial_tracker and dual_stream:
left_energy = dual_stream.left.get_energy() if dual_stream.left else 0.0
right_energy = dual_stream.right.get_energy() if dual_stream.right else 0.0
result = spatial_tracker.update(state.doa, left_energy, right_energy)
if result:
state.spatial = result
gx, gy = result["gaze_x"], result["gaze_y"]