1. Biophysical Principles & Signal-To-Noise Dynamics
Electroencephalography (EEG) is a non-invasive, semi-invasive, or fully invasive neuroimaging modality that measures macroscopic ionic current flows resulting from synchronous post-synaptic potentials across cortical pyramidal neurons. The voltage signals registered at the scalp surface range from $10\,\mu\text{V}$ to $100\,\mu\text{V}$ peak-to-peak, operating across a low-frequency power spectrum ($\approx 0.5\,\text{Hz}$ to $100\,\text{Hz}$). Because these biopotentials are orders of magnitude weaker than atmospheric electromagnetic radiation, triboelectric static, and electromyographic (EMG) biological artifacts, the single most critical baseline metric for any neural recording apparatus is its Signal-to-Noise Ratio (SNR).
The decibel-scaled signal-to-noise ratio of an electrophysiological acquisition front-end is quantified by:
$$SNR_{\text{dB}} = 10 \log_{10} \left( \frac{P_{\text{signal}}}{P_{\text{noise}}} \right) = 20 \log_{10} \left( \frac{A_{\text{signal}}}{A_{\text{noise}}} \right)$$
Where $P_{\text{signal}}$ represents the electrical power spectral density of the physiological signal of interest (e.g., $10\,\text{Hz}$ occipital alpha synchronization), and $P_{\text{noise}}$ is the aggregate noise power contributed by thermal noise across electrode-skin impedance interfaces ($Z_{\text{contact}}$), active semiconductor amplifiers, power-line interference ($50/60\,\text{Hz}$ capacitive coupling), movement artifacts, and muscular contraction biopotentials. The total observed voltage signal $v(t)$ at any discrete temporal index $t$ is expressed as an additive stochastic process:
$$v(t) = s(t) + n_{\text{thermal}}(t) + n_{\text{impedance}}(t) + n_{\text{artifact}}(t)$$
In low-cost consumer dry-electrode devices (e.g., $6\,\text{dB}$ to $14\,\text{dB}$ SNR), high contact resistance ($Z > 500\,\text{k}\Omega$) leads to severe baseline drift and high thermal Nyquist-Johnson noise variance ($\sigma_n^2 = 4 k_B T R \Delta f$). Conversely, high-end research systems ($22\,\text{dB}$ to $25\,\text{dB}$ SNR) employ active wet $\text{Ag/AgCl}$ electrodes with conductive chloride gels ($Z < 5\,\text{k}\Omega$) and ultra-low-noise operational amplifiers. Fully invasive or sub-scalp implantable micro-arrays ($20\,\text{dB}$ to $35\,\text{dB}$ SNR) penetrate or sit beneath the high-impedance cranial barrier, bypassing skull dielectric attenuation ($R_{\text{bone}} \approx 80 \times R_{\text{brain}}$) and yielding pristine single-unit or local field biopotentials with minimal capacitive signal degradation.
3. Mathematical Software Architecture & Simulation Engineering
The simulation workspace utilizes zero-dependency vanilla JavaScript optimized for high-density $DPR$ displays. The visualizer decoupled pipeline avoids layout shifts by maintaining a rigid aspect-ratio wrapper and adjusting canvas backing store pixel buffers dynamically:
$$W_{\text{buffer}} = \lfloor W_{\text{rect}} \times \text{DPR} \rfloor, \quad H_{\text{buffer}} = \lfloor H_{\text{rect}} \times \text{DPR} \rfloor$$
The synthetic EEG trace engine computes discrete voltage amplitudes $S[k]$ at time sampling steps $t_k = k \cdot \Delta t$ (simulated $F_s = 500\,\text{Hz}$) using a composite physiological signal model combined with Box-Muller Gaussian additive noise transformation:
$$s(t_k) = A_{\alpha} \sin(2\pi f_0 t_k) + 0.25 A_{\alpha} \sin(4\pi f_0 t_k) + \eta(t_k)$$
$$\eta(t_k) = \sigma_{\text{device}} \cdot \sqrt{-2 \ln(u_1)} \cos(2\pi u_2)$$
Where $u_1, u_2 \sim U(0,1)$ are independent uniform random variables, and the device noise standard deviation $\sigma_{\text{device}}$ is inversely derived from the decibel rating:
$$\sigma_{\text{device}} = A_{\text{signal}} \cdot 10^{-\frac{SNR_{\text{dB}}}{20}}$$
According to the Shannon-Hartley theorem, the upper bound on the information capacity $C$ (in bits per second) transmitted by a neural communication channel or Brain-Computer Interface (BCI) is directly constrained by system SNR and signal bandwidth $B$:
$$C = B \log_2 \left( 1 + 10^{\frac{SNR_{\text{dB}}}{10}} \right)$$
This equation underscores why high-SNR clinical and implantable devices achieve significantly higher information transfer rates (ITR) in motor prosthetic decoding compared to consumer dry-sensor headbands.