Overview: The Electrophysiological Foundations of EEG Analysis
Electroencephalography (EEG) is a non-invasive neuroimaging modality that captures the macroscopic
electrical oscillations generated by synchronized postsynaptic potentials across vast populations
of cortical pyramidal neurons. When neurotransmitters bind to postsynaptic receptors on dendritic
trees oriented perpendicular to the cortical surface, dipolar current flows are established within
the extracellular matrix. These currents conduct through complex volume conduction pathways—traversing
the cerebral spinal fluid (CSF), meninges, cranium, and scalp—to register microvolt-level potential
differences ($\approx 5\text{ to }100\,\mu\text{V}$) across surface recording electrodes arranged
according to standardized anatomical matrices such as the International 10–20 or 10–10 Systems.
Cortical electrodynamics are classically segmented into distinct spectral frequency bands, each
reflecting specific functional states of neurocognitive arousal, thalamocortical gating, and metabolic
equilibrium:
- Delta Band ($1 - 4\,\text{Hz}$): High-amplitude, slow oscillations dominant
during Stage N3 slow-wave sleep (SWS) and pathological cortical deafferentation or encephalopathy.
- Theta Band ($4 - 8\,\text{Hz}$): Rhythms generated predominantly within
hippocampal-prefrontal circuits, associated with spatial navigation, memory encoding, meditative
drowsiness, and cognitive workload.
- Alpha Band ($8 - 12\,\text{Hz}$): The posterior dominant rhythm (PDR), maximum
over the occipital region ($O_1, O_2, O_z$) during relaxed, eyes-closed wakefulness, which
synchronously attenuates upon visual fixation or cognitive engagement (Berger effect / alpha desynchronization).
- Beta Band ($12 - 30\,\text{Hz}$): Low-amplitude, desynchronized fast activity
predominant over fronto-central regions ($F_3, F_4, C_3, C_4$), reflecting active mental alertness,
motor inhibition, and sensorimotor processing (sensorimotor rhythm, SMR).
- Gamma Band ($30 - 45+\,\text{Hz}$): Microvolt-level binding oscillations tied
to local interneuronal GABAergic feedback networks ($PV^+$ basket cells), indicative of feature
integration, conscious perception, and complex multi-sensory synthesis.
Extracting pure neurophysiological signals from raw scalp recordings represents a formidable digital
signal processing challenge. Scalp recordings are chronically corrupted by environmental electromagnetic
fields (e.g., $50\,\text{Hz}$ or $60\,\text{Hz}$ AC powerline hum), electrode-electrolyte polarization
drifts ($< 0.5\,\text{Hz}$), electrooculographic (EOG) ocular blinks, and high-amplitude electromyographic
(EMG) muscle activity ($> 30\,\text{Hz}$). This interactive laboratory paired with a curated software
directory bridges theoretical neurobiology, digital filter mathematical design, and open-source software
engineering workflows.
How to Use: Operational Workflows & Parameter Exploration
The laboratory terminal combines a 3-channel real-time oscilloscope monitor ($F_{p1}$ Frontal,
$C_3$ Central, $O_1$ Occipital) with recursive digital filter blocks, artifact generators, and a
dynamic neurosoftware registry profiler. Follow these structured workflows to test signal processing
and software architectures:
- Synthesizing Canonical Neural Rhythms: Adjust the sliders in 1. Neural
Rhythms to modulate band powers. For example, increase the Alpha Slider
to $40\,\mu\text{V}$ and notice the pronounced sinusoidal oscillation on the Occipital ($O_1$) lead.
Elevate Delta to simulate slow-wave sleep or Beta/Gamma to observe
high-frequency low-amplitude cortical activation patterns.
- Investigating Powerline Interference & IIR Notch Filtering: Advance the
50 Hz Line Hum slider to introduce severe harmonic distortion onto all leads.
Observe how the signal trace thickens into high-amplitude mains hum. Toggle the Notch
Filter switch to activate the recursive $50\,\text{Hz}$ second-order IIR notch difference
equation, instantly nullifying line interference while preserving underlying Alpha and Beta waves.
- Simulating Biological Artifacts & Topographic Conduction:
Click the Blink ($F_{p1}$) button. A massive half-sine electrooculographic
potential will violently deflect the frontal lead ($F_{p1}$) due to anatomical proximity to the
corneoretinal dipole, with minimal forward spread reaching the occipital lead ($O_1$). Click
Muscle EMG to inject high-frequency myogenic noise, and toggle the Low-Pass
Filter (35 Hz) to observe high-frequency attenuation.
- Acoustic Audification & Binaural Brainwave Mapping: Click 🔇 Sound:
OFF to engage the Web Audio synthesis engine. The left channel outputs a steady carrier
tone ($180\,\text{Hz}$), while the right channel is detuned by an offset $\Delta f$ matching the
statistically dominant neural frequency band, generating acoustic binaural beats in real-time.
- Exploring the Software Ecosystem: Query the curated directory table by typing
in the search bar or clicking the license filter pills (e.g., ## Open Source, SDK / API).
Click on individual cards to inspect runtime architecture, primary programming languages, and direct
verified links to official repositories.
- Engaging Automated Demo Sweep: Click Start Demo to initialize
an automated parametric sweep that dynamically transitions through multiple arousal states, demonstrates
filtering stages, and tests artifact suppression before restoring your exact previous manual baseline
upon any user click or adjustment.
Technical Details: Mathematical Modeling, Difference Equations & Architecture
The laboratory utilizes raw, uninhibited browser APIs to maintain an optimal Interaction to Next Paint
(INP) rating below 50 milliseconds while executing high-throughput discrete-time recursive filtering
at a baseline sampling rate of $f_s = 250\,\text{Hz}$ ($T_s = 4\,\text{ms}$).
1. Recursive Digital Filter Formulations
Rather than relying on non-causal frequency-domain Fast Fourier Transform (FFT) overlap-add routines
which introduce processing latency, this engine implements direct Infinite Impulse Response (IIR)
difference equations on a sample-by-sample basis:
A. Single-Pole High-Pass Filter (DC Offset Suppression, $f_c = 0.5\,\text{Hz}$):
$$y[n] = \alpha_{\text{HP}} \cdot \Big( y[n-1] + x[n] - x[n-1] \Big), \quad \text{where } \alpha_{\text{HP}} = \frac{1}{1 + 2\pi f_c T_s} \approx 0.9876$$
B. 2nd-Order Recursive Notch Filter ($f_0 = 50\,\text{Hz}$, Pole Radius $r = 0.95$):
$$H(z) = b_0 \frac{1 - 2\cos(\omega_0)z^{-1} + z^{-2}}{1 - 2r\cos(\omega_0)z^{-1} + r^2 z^{-2}}, \quad \omega_0 = 2\pi \frac{f_0}{f_s}$$
$$y[n] = b_0 x[n] - 2b_0\cos(\omega_0)x[n-1] + b_0 x[n-2] + 2r\cos(\omega_0)y[n-1] - r^2 y[n-2]$$
C. Single-Pole Low-Pass Filter (Myogenic Suppression, $f_{\text{LP}} = 35\,\text{Hz}$):
$$y[n] = y[n-1] + \alpha_{\text{LP}} \cdot \Big( x[n] - y[n-1] \Big), \quad \text{where } \alpha_{\text{LP}} = 1 - e^{-2\pi f_{\text{LP}} T_s} \approx 0.45$$
2. Biophysical Artifact & Volume Conduction Modeling
The corneoretinal electrical potential generates a steady electrical dipole $\mathbf{p}_{\text{ocular}}$
where the cornea acts as the positive pole and the retina as the negative pole ($\approx 10 - 30\,\text{mV}$).
Upon eyelid closure, the Bell phenomenon produces upward ocular rotation, projecting a transient
monophasic positive deflection onto the frontopolar leads ($F_{p1}, F_{p2}$). The observed scalp
potential at lead $k$ is calculated via forward volume conduction attenuation coefficients:
$$V_k(t) = \sum_{m \in \{\delta, \theta, \alpha, \beta, \gamma\}} A_m \sin(2\pi f_m t + \phi_{m,k}) + g_{\text{EOG}, k} \cdot E_{\text{blink}}(t) + g_{\text{EMG}, k} \cdot \eta_{\text{myo}}(t) + V_{\text{hum}}(t)$$
$$\text{where } g_{\text{EOG}, F_{p1}} = 1.25, \quad g_{\text{EOG}, C_3} = 0.35, \quad g_{\text{EOG}, O_1} = 0.10$$
3. Web Audio Synthesis Architecture
The audification module constructs an isolated Web Audio graph composed of dual discrete sinusoidal
oscillators routed into a stereo channel merger. The left channel is maintained at a fundamental base
carrier $f_{\text{carrier}} = 180\,\text{Hz}$, while the right channel is modulated by a dynamic offset
matching the spectral mode:
$$s_{\text{stereo}}(t) = \begin{bmatrix} A_0 \sin(2\pi f_{\text{carrier}} t) \\ A_0 \sin(2\pi (f_{\text{carrier}} + f_{\text{dominant}}) t) \end{bmatrix}$$
Future Directions: Emerging Neurotechnology Paradigms
The neurotechnology software ecosystem is currently undergoing a structural architectural shift from
isolated desktop binary executables toward browser-native, WebAssembly-compiled, and cloud-distributed
computing frameworks:
- Web Serial and Web Bluetooth Direct Streaming: Modern standards (W3C Web Bluetooth
API) allow web applications to establish low-latency, encrypted BLE GATT connections directly to
commercial and open-hardware biosensors (e.g., OpenBCI Cyton, Muse S, Emotiv, Neurosity Crown)
without requiring third-party drivers or background daemon installations.
- WebAssembly-Accelerated Processing Pipelines: Compiling established C/C++ signal
processing kernels (e.g., EEGLAB's infomax ICA, MNE-C source localization algorithms, and BrainFlow
data filters) into WebAssembly ($Wasm$) enables multithreaded SIMD vectorization at near-native
execution speeds inside web workers.
- Browser-Native Deep Learning & Neural Decoders: Leveraging WebGPU inference engines
(ONNX Runtime Web, TensorFlow.js) facilitates client-side, zero-latency execution of spatial-temporal
convolutional networks (e.g., EEGNet, Conformer) for real-time motor imagery classification, P300
event-related potential detection, and clinical seizure prediction directly within standard web
browsers.
EEG Tools & Software Ecosystem Reference Directory
The following curated directory compiles foundational software suites, scientific toolboxes, SDKs,
and developer APIs across open-source and commercial neurotechnology domains. Open-source tools are
indicated with the ## OSS identifier.
EEG Software & Analysis Platforms:
EEG SDKs & Hardware Interfaces:
EEG APIs & Developer Pathways: