EEG Brain Wave Analyzer Fuzzy Inference System

AUTO DEMO RUNNING

Brain State Presets

Manual Wave Adjustments

Dominant Frequency 10.0 Hz
Amplitude (RMS) 45 µV
Signal Complexity (Noise) 15%

Active Membership

Delta (0.5-4 Hz):0.0
Theta (4-8 Hz):0.0
Alpha (8-12 Hz):0.0
Beta (12-30 Hz):0.0
Gamma (30-45 Hz):0.0
Real-time Electroencephalogram (EEG) Trace 10.0 Hz | 45µV
Fuzzy Logic Controller & State Classifier Mamdani Inference Model
Deep Sleep
Drowsy / Dream
Relaxed / Calm
Focused Active
Excited / High Alert

Fuzzy Logic Application in EEG Analysis

Electroencephalogram (EEG) waveforms represent complex electrical fields generated by synchronized neural populations inside the cerebral cortex. Because biological systems exhibit inherently fuzzy borders, sharp, discrete boundaries are ill-suited for describing cognitive shifts. For example, standard medical protocols define the Alpha band strictly from 8 to 12 Hz. However, a biological oscillation at 7.9 Hz in a relaxed subject behaves structurally like an Alpha wave, even though it formally falls into the Theta domain.

Fuzzy System Architecture

To address these ambiguous biological boundaries, this interactive simulator implements a Mamdani-style Fuzzy Inference System (FIS). The inputs to the fuzzy engine are the synthetic EEG signal's Dominant Frequency and Root-Mean-Square Amplitude.

1. Fuzzification (Membership Functions)

The frequency input spectrum is mapped using overlapping triangular ($\mu_{\text{tri}}$) and trapezoidal ($\mu_{\text{trap}}$) membership functions corresponding to standard neurological profiles:

- Delta (Deep Sleep): trapezoidal(x, 0, 0, 3, 5.5)
- Theta (Dreaming/Drowsy): triangular(x, 3.5, 5.5, 8.5)
- Alpha (Relaxed Awareness): triangular(x, 7.5, 10, 12.5)
- Beta (Focused Attention): trapezoidal(x, 11.5, 15, 28, 32)
- Gamma (High Executive Processing): trapezoidal(x, 28, 35, 45, 50)

2. Rule Base & Defuzzification

The controller applies fuzzy logical conjunctions (AND) represented by the minimum operator over raw input memberships to evaluate human mental states:

- Rule 1: IF Frequency IS Delta AND Amplitude IS High, THEN State is "Deep Sleep".
- Rule 2: IF Frequency IS Theta AND Amplitude IS Medium, THEN State is "Drowsy / Dream".
- Rule 3: IF Frequency IS Alpha AND Amplitude IS Medium, THEN State is "Relaxed / Calm".
- Rule 4: IF Frequency IS Beta AND Amplitude IS Low, THEN State is "Focused Active".
- Rule 5: IF Frequency IS Gamma AND Amplitude IS Low-to-Medium, THEN State is "Excited / High Alert".

The winning crisp state is dynamically highlighted on the dashboard interface based on the maximum product of frequency activation and corresponding signal power constraints.

Sonification (Binaural Auditory Beats)

An optional, integrated sonification tool utilizes standard Web Audio components to map biological frequency directly into acoustic patterns. By splitting stereo signals, a 150 Hz carrier wave is delivered to the left speaker, and a carrier offset by the exact EEG target frequency is delivered to the right channel. This produces a "Binaural Beat" within the brain stem, physically demonstrating the entrainment mechanism utilized in modern neurofeedback training.

Technical Implementation & Future Scope