Overview
Echolocation is an interactive audio-sensory laboratory and pure-tone audiometry simulation framework designed to chart human auditory perception thresholds across standard clinical frequency bands. By combining real-time Web Audio API signal synthesis with interactive spatial mechanics, this platform evaluates perceptual auditory boundaries without introducing the cognitive monotony typically associated with traditional clinical pure-tone diagnostic protocols.
Human auditory perception spans a dynamic frequency spectrum extending roughly from $20\text{ Hz}$ to $20,000\text{ Hz}$, with clinical pure-tone testing primarily focusing on the octave frequencies between $250\text{ Hz}$ and $8000\text{ Hz}$. Sound perception is non-linear; the human ear exhibits varying sensitivity across frequencies as defined by equal-loudness contours (Fletcher-Munson curves). In clinical audiometry, sound intensities are measured in Hearing Level ($\text{dB HL}$), normalized relative to standard human hearing thresholds where $0\text{ dB HL}$ represents the median minimum audible acoustic pressure $p_0 = 20\text{ }\mu\text{Pa}$ at $1000\text{ Hz}$.
This interactive laboratory dynamically tracks pure-tone threshold boundaries using an adaptive psychoacoustic staircase algorithm. Users engage in a dual-task sensory paradigm: navigating a spatial ring to collect kinetic energy tokens (yellow fireflies) while remaining vigilant for faint background acoustic sonar pulses. This continuous baseline task maintains user focus, optimizing response timing and minimizing cognitive threshold fatigue.
How to Use
Follow this sequential operational protocol to conduct an adaptive auditory threshold evaluation:
- Acoustic Workspace Preparation: Ensure you are positioned in a quiet environment. High-fidelity stereo headphones are strongly recommended to isolate left/right channel frequency responses.
- Enabling Sound Synthesis: Click the 🔊 SOUND OFF / SOUND ON toggle button located at the top-right of the control panel to initialize the Web Audio API synthesis engine. System volume should be calibrated to a comfortable baseline (approx. 50% system output).
- Initiating Calibration: Click START DIAGNOSIS (or press Start Demo to inspect automated diagnostic behavior). Guide the central player ring across the dark radar grid using mouse movement or touch drag coordinates to collect glowing yellow fireflies ($+15$ score energy increment).
- Sonar Pulse Perception & Response: At random intervals, pure-tone acoustic sonar pulses ranging from $250\text{ Hz}$ to $8000\text{ Hz}$ will emit at varying sound pressure levels ($10\text{ dB}$ to $100\text{ dB}$). The moment you perceive a faint pulsing tone in the background, press the SPACEBAR or tap the green DETECT SONAR button immediately.
- Adaptive Staircasing Feedback: If a tone is correctly perceived, the algorithm reduces the intensity level for that specific frequency by $10\text{ dB}$ on subsequent trials ($+75$ score bonus). If a pulse elapses without detection, the system increases the tone intensity by $5\text{ dB}$ ($-10$ penalty). Incorrect detections incur a $-25$ false alarm penalty.
- Exporting Data: View live vector curves rendered on the clinical audiogram overlay matrix. Click Export CSV Profile to download the full trial sequence including timestamped frequencies, intensity levels, and perception flags.
Technical Details
The core signal generation architecture relies on the native Web Audio API `AudioContext`, constructing pure sine wave oscillators programmatically at runtime. A pure acoustic tone is defined mathematically as a sinusoidal pressure wave:
$$p(t) = A \cdot \sin(2\pi f t + \phi)$$
Where $A$ represents the peak acoustic pressure amplitude, $f$ is the target frequency in Hertz ($\text{Hz}$), $t$ is time in seconds, and $\phi$ is the initial phase angle. To prevent acoustic transients (speaker clicks or pops during sudden onset/offset), exponential gain ramping is applied via an explicit linear envelope:
$$G(t) = \begin{cases} G_{\text{max}} \cdot \frac{t - t_0}{\tau_{\text{attack}}}, & t_0 \le t < t_0 + \tau_{\text{attack}} \\ G_{\text{max}}, & t_0 + \tau_{\text{attack}} \le t < t_0 + t_{\text{pulse}} - \tau_{\text{decay}} \\ G_{\text{max}} \cdot \left(1 - \frac{t - (t_0 + t_{\text{pulse}} - \tau_{\text{decay}})}{\tau_{\text{decay}}}\right), & t_0 + t_{\text{pulse}} - \tau_{\text{decay}} \le t \le t_0 + t_{\text{pulse}} \end{cases}$$
Where gain amplitude $G_{\text{max}}$ maps to decibel Hearing Level ($\text{dB HL}$) via an exponential transfer function:
$$G_{\text{max}}(L) = 10^{\frac{L - 100}{40}}$$
The threshold search engine executes a modified clinical Hughson-Westlake adaptive staircase procedure. The intensity level $L_{k+1}$ for trial $k+1$ at frequency $f$ is governed by the binary response outcome $R_k \in \{0, 1\}$ (where $1 = \text{heard}$, $0 = \text{missed}$):
$$L_{k+1}(f) = \begin{cases} \max\left(L_{\text{min}}, L_k(f) - 10\text{ dB}\right), & \text{if } R_k = 1 \text{ (Heard)} \\ \min\left(L_{\text{max}}, L_k(f) + 5\text{ dB}\right), & \text{if } R_k = 0 \text{ (Missed)} \end{cases}$$
Minimum threshold limits $\hat{T}(f)$ are statistically calculated by averaging the intensity values recorded at $N_R$ reversal points (inflection points where sequence orientation flips from descending to ascending or vice versa):
$$\hat{T}(f) = \frac{1}{N_R} \sum_{i=1}^{N_R} R_i(f)$$
To maintain high rendering performance and zero input latency across diverse client displays, the visualizer uses high-DPI device pixel ratio ($DPR$) normalization. Canvas backing-store dimensions ($\text{width} \times DPR$, $\text{height} \times DPR$) scale dynamically relative to bounding container geometries without mutating inline CSS rules, preventing spatial pixelation or infinite layout expansion loops.
Future Directions
The ongoing development roadmap targets enhanced clinical utility and deeper analytical features:
- 3D Spatial Binaural HRTF Integration: Incorporating Head-Related Transfer Functions (HRTF) to evaluate spatial sound localization and directional hearing loss vectors in a simulated three-dimensional acoustic landscape.
- Environmental Microphone Self-Calibration: Implementing an ambient acoustic noise screening routine using client microphone streams to quantify background noise spectral density before initiating diagnostic trials.
- Extended Ultra-High Frequency Diagnostic Suite: Extending pure-tone test spectra up to $16,000\text{ Hz}$ to screen for early ototoxicity, noise-induced hearing loss, and high-frequency hair cell degeneration.
- Machine Learning Threshold Estimation: Implementing Bayesian decision trees to accelerate convergence onto true sensory thresholds in under 50% of standard trial iterations.