1. Scientific Overview & Phase Space Mathematics
Lissajous figures are parametric vector curves constructed by plotting two oscillating mathematical functions against one another on orthogonal Axes ($X$ and $Y$). In non-linear dynamic systems analysis and biomedical engineering, converting scrolling single-dimensional time-domain biosignals—such as electroencephalograms (EEG) or electrocardiograms (ECG)—into state-space or vector phase-space plots exposes subtle temporal correlations, harmonic distortions, and phase delays that remain visually hidden on traditional multi-lead strip charts.
For two pure sinusoidal orthogonal signals, the canonical parametric equations are defined by:
$$x(t) = A \sin(a \cdot t + \delta), \quad y(t) = B \sin(b \cdot t)$$
Where $A$ and $B$ represent peak scalar amplitudes, $a$ and $b$ represent fundamental angular frequencies (Hz), and $\delta$ denotes the phase angle shift in radians. When the ratio $a/b$ is rational, the trajectory traces out a closed, stationary curve. When the ratio is irrational or subjected to phase drift ($\delta(t)$), the geometry continuously rotates, illustrating dynamic phase evolution.
For identical frequencies ($a = b$), the parametric equation simplifies to the algebraic implicit form of an ellipse:
$$\frac{x^2}{A^2} + \frac{y^2}{B^2} - \frac{2xy}{AB} \cos(\delta) = \sin^2(\delta)$$
In clinical vectorcardiography (VCG), Lead I (horizontal depolarization $X$) and Lead II or $aVF$ (vertical depolarization $Y$) form dynamic loops tracing atrial ($P$-wave), ventricular contraction ($QRS$ complex), and ventricular repolarization ($T$-wave) vectors. Conduction perturbations, such as Left Bundle Branch Blocks (LBBB), introduce micro-second latency lags $\delta$, opening closed VCG loops and altering vector eccentricity long before clear temporal waveform broadening manifests on a standard 12-lead ECG monitor.
2. How to Use the Simulator
This interactive laboratory allows real-time manipulation of dual-channel wave parameters, visual phase space reconstruction, and spatial vector audio feedback:
- Start Demo: Initiates an automated clinical presentation tour. It sequentially traverses all presets while demonstrating dynamic phase shifts. Interacting with any control instantly interrupts the demo mode and restores your custom configuration state.
- Reset Baseline: Instantly resets all frequency sliders, amplitudes, phase shifts, and signal generators back to baseline parameters.
- Channel A & B Controls: Adjust individual frequency multipliers ($a, b$), signal amplitudes ($A, B$), and select distinct physiological waveforms (Sine, ECG, EEG, Synchronous Seizure, and Asynchronous Seizure).
- Phase Shift ($\delta$ Slider): Modulates the phase delay angle between $-\pi$ and $+\pi$ radians ($-3.14$ to $+3.14$). Watch how small phase shifts ($0.15 \text{ rad}$) transform single lines into open elliptical phase loops.
- Sound Synthesis (Web Audio Engine): Clicking
🔇 SOUND OFF activates a stereo binaural sonification system. Channel A maps to horizontal stereo panning ($X$-axis position) and Channel B maps to vertical positioning ($Y$-axis deflection), allowing auditory tracking of vector orbits.
3. Technical Architecture & Web Audio Engine
The simulator is built with high-performance vanilla JavaScript and a decoupled HTML5 `
$$W_{\text{buffer}} = W_{\text{CSS}} \times \text{DPR}, \quad H_{\text{buffer}} = H_{\text{CSS}} \times \text{DPR}$$
The physiological signal engines synthesize mathematical models in real-time frame sweeps:
- Synthesized ECG Model: Evaluates a linear combination of five localized Gaussian kernels representing $P, Q, R, S,$ and $T$ electrical deflections:
$$f_{\text{ECG}}(\phi) = \sum_{i \in \{P,Q,R,S,T\}} a_i \exp\left( -\frac{(\phi - \mu_i)^2}{2\sigma_i^2} \right)$$
- EEG Brainwave & Seizure Engines: Superimposes fundamental alpha/theta oscillations with randomized neural micro-jitter ($\xi \sim \mathcal{N}(0, \sigma^2)$) and high-voltage 3Hz spike-and-slow-wave epileptic paroxysms.
- Stereo Sonification Pipeline: Dual Web Audio `OscillatorNode` instances generated with warm triangle wave profiles are filtered through a lowpass $BiquadFilterNode$ ($H(s) = \frac{\omega_c}{s + \omega_c}$ at $400\text{ Hz}$). Stereo coordinates update via `StereoPannerNode` ($pan = \text{clamp}(X / 1.5, -1, 1)$), producing a binaural 3D auditory orbit tracking vector motion.