Filter node

FFT EEG

Real-time multi-channel EEG spectral analysis node. Processes raw brainwave data from a BrainBrick Device Input into clinically relevant frequency band powers, full power spectral density, cross-channel coherence, and hemispheric asymmetry metrics -- all output as structured JSON for visualization, conditional logic, and downstream processing.

Inputs

PortTypeDefault
EnableOff stops the analysis and drops the collected samples, so the next start begins from a fresh buffer.booltrue
EEG DataThe multi-channel EEG to analyse: EEG Data from BrainBrick Device Input, or a Signal in µV (EEG Stream Receive, Signal Channels, a filter). An empty or disconnected source simply keeps the last analysis on the outputs.structure—
FFT SizeSamples per analysis window — bigger means finer frequency detail but a slower, more sluggish reading. Snapped to the nearest power of two within 1024…131072, and further reduced if the incoming buffer cannot hold two windows.int65536
Update RateHow many analyses per second to run. 0 means as often as new data allows; a few per second is plenty for smooth band values and costs far less.float0.0
Coherence EnableTurns on the pairwise coherence output, which measures how synchronised two electrodes are. Off by default because it costs extra work every analysis.boolfalse
Asymmetry EnableTurns on the left-versus-right asymmetry output for mirrored electrode pairs. Off by default because it costs extra work every analysis.boolfalse

Outputs

PortType
Analysisjson
Total Powerjson
Dominant Bandjson
Spectrumjson
Coherencejson
Asymmetryjson
Notch Hzfloat
Readybool
Channelsint

Screenshots

FFT EEG node with 6 inputs and 9 outputs
FFT EEG node with 6 inputs and 9 outputs
Settings Inspector — preprocessing, FFT, band configuration, artifact detection, coherence pairs, asymmetry mapping, and diagnostics
Settings Inspector — preprocessing, FFT, band configuration, artifact detection, coherence pairs, asymmetry mapping, and diagnostics
Analysis output — per-channel band powers, peak frequencies, artifact flags
Analysis output — per-channel band powers, peak frequencies, artifact flags
Total Power output — integrated power (uV²) per electrode
Total Power output — integrated power (uV²) per electrode
Dominant Band output — strongest frequency band per channel
Dominant Band output — strongest frequency band per channel
Spectrum output — raw PSD array (32769 bins) per channel
Spectrum output — raw PSD array (32769 bins) per channel
Coherence output — cross-channel magnitude-squared coherence by band
Coherence output — cross-channel magnitude-squared coherence by band
Asymmetry output — hemispheric asymmetry index per band and pair
Asymmetry output — hemispheric asymmetry index per band and pair

Live Preview

Interactive — The Welch PSD method, step by step

Signal Processing Pipeline

The FFT EEG node implements a complete EEG signal processing chain. Data flows through the following stages:

1. Ingestion (MainActor, ~50 us)

Raw interleaved samples are read from the BrainBrick Device Input's shared MTLBuffer (Metal Unified Memory, zero-copy). The ingestion step:

  • De-interleaves the multi-channel data from [ch0_sample0, ch1_sample0, ch0_sample1, ch1_sample1, ...] into per-channel arrays.
  • Handles ring buffer wraparound (the MTLBuffer is circular; the read position may wrap to the beginning).
  • Tracks the write head position to read only new samples since the last frame.
  • Detects gaps (if delta >= maxFrames, the buffer has wrapped completely and data is stale — triggers a full reset).
  • Detects buffer changes (device reconnection creates a new MTLBuffer — triggers a full reset).

2. DC Removal (per sample)

A very slow exponential moving average (EMA) tracks the DC baseline of each channel:

  • Time constant: tau = 10 seconds at 16 kHz --> -3 dB at 0.016 Hz
  • This is well below the lowest EEG band (Delta starts at 0.5 Hz), so no EEG signal is affected
  • Purpose: removes large DC offsets from the ADC before they reach the IIR filter, preserving Float32 precision

3. High-Pass Filter (4th-order Butterworth)

A 4th-order Butterworth high-pass filter (two cascaded 2nd-order biquad sections) removes residual sub-Hz drift:

  • Default cutoff: 0.1 Hz (configurable in Settings)
  • True 4th-order pole placement: Q1 = 0.5412, Q2 = 1.3066
  • 80 dB/decade rolloff for effective drift removal
  • Implemented using vDSP_biquad (Apple Accelerate framework) with Double-precision coefficients and Float I/O

4. Notch Filter (powerline removal)

Removes 50 Hz or 60 Hz powerline interference plus harmonics:

  • Fundamental — Two cascaded 2nd-order IIR notch filters at the center frequency for >-40 dB attenuation
  • 2nd harmonic (100/120 Hz) — Two more cascaded notch sections (optional, enabled by Harmonics setting)
  • 3rd harmonic (150/180 Hz) — Two more cascaded notch sections (optional)
  • Configurable Q factor (default 30.0) — higher Q = narrower notch = less signal loss near the center frequency
  • Adaptive mode — Tracks the actual powerline frequency by detecting the peak in the PSD near the nominal frequency, with EMA smoothing and hysteresis

5. Welch PSD Computation (Actor, ~5 ms, GPU or CPU)

Power spectral density is computed using Welch's averaged periodogram method:

  1. The internal buffer (3x FFT size per channel) is segmented into overlapping windows
  2. Default overlap: 50% (configurable) — with 3x buffer, this yields approximately 5 averaged segments
  3. Each segment is mean-subtracted (robust DC removal independent of HP filter)
  4. Optional linear detrend removes any remaining linear drift within the segment
  5. A window function is applied (Hanning default, Hamming, or Blackman available)
  6. Forward FFT via vDSP_fft_zrip (CPU) or Metal compute shader (GPU)
  7. Magnitude-squared spectrum is computed and scaled to one-sided PSD density (uV^2/Hz)
  8. PSD arrays from all segments are averaged to reduce variance

The computation is dispatched to a dedicated FFTEEGProcessor actor. Only one FFT task runs per node at a time (guard prevents overlap). Results are stored in an atomic cache (os_unfair_lock) for zero-cost synchronous reads from the MainActor.

GPU acceleration — When available, the node uses a Metal compute shader (WelchPSDMetalEngine) for the windowing, FFT, and PSD computation stages. The CPU path serves as an automatic fallback. All channels are processed in parallel via DispatchQueue.concurrentPerform.

6. Band Power Extraction

After PSD computation, absolute and relative power are calculated for each frequency band:

  • Absolute power = sum of PSD bins within band x frequency resolution (integrated power in uV^2)
  • Relative power = band power / total power (fraction, 0 — 1)
  • Peak frequency = frequency of the highest PSD bin within the band
  • Peak amplitude = PSD value at the peak frequency
  • Dominant band = band with the highest absolute power (excluding Custom and Mu)

7. Artifact Detection

If enabled, channels with total power exceeding the artifact threshold (default 500 uV^2) are flagged. Artifact-flagged channels:

  • Are marked with "artifact": true in the Analysis output
  • Have their asymmetry results reported as null when both channels in a pair are flagged
  • Are still included in coherence computation (user may filter downstream)

8. Coherence Computation (optional)

Magnitude-squared coherence (MSC) measures the linear relationship between two channels at each frequency:

Coh_xy(f) = |<S_xy(f)>|^2 / (<S_xx(f)> x <S_yy(f)>)

Where <...> denotes averaging over multiple segments. Range: 0 (no relationship) to 1 (perfect linear relationship).

Critical implementation detail: Single-segment coherence is always 1.0 (Cauchy-Schwarz identity). Meaningful coherence requires multi-segment averaging. The node uses shorter 4096-point segments with 50% overlap from the full buffer, yielding approximately 30 segments for robust averaging.

All channel pairs are computed in parallel. The output is grouped by frequency band, with each band containing coherence values for all configured pairs (or all unique pairs if none are configured).

9. Asymmetry Computation (optional)

Hemispheric asymmetry index (AI) quantifies power differences between left and right hemisphere electrodes:

AI(band) = (Power_right - Power_left) / (Power_right + Power_left)

Range: -1.0 (left dominant) to +1.0 (right dominant), 0.0 = symmetric.

Computed per band for each configured left/right channel pair. If no pairs are configured, adjacent channels are paired automatically (0-1, 2-3, 4-5, ...).

Frequency Bands

BandDefault RangeTypical EEG Association
Delta0.5 — 4 HzDeep sleep, unconsciousness, brain injury markers
Theta4 — 8 HzDrowsiness, light sleep, meditation, memory encoding
Alpha8 — 12 HzRelaxed wakefulness, eyes closed, occipital dominance
Beta12 — 30 HzActive thinking, focus, anxiety, motor planning
Gamma30 — 90 HzHigher cognitive functions, perception, consciousness
Mu8 — 13 HzSensorimotor rhythm (overlaps Alpha), suppressed by movement/motor imagery
Custom0.5 — 100 HzUser-defined range, configurable in Settings

All band boundaries are configurable in the node's Settings tab. The Custom band allows monitoring any frequency range of interest.

Settings (Inspector)

The FFT EEG node has extensive settings accessible through the Inspector panel's Settings tab:

Preprocessing

SettingDefaultDescription
Notch FilterOnEnable/disable powerline interference removal.
Notch Frequency50 HzSelect 50 Hz (Europe, Asia, Africa) or 60 Hz (Americas, Japan).
HarmonicsOnAlso filter 2nd and 3rd harmonics (100/120 Hz, 150/180 Hz).
Notch Q30.0Quality factor of the notch filter. Higher = narrower notch.
Adaptive NotchOffAutomatically detect and track the actual powerline frequency.
Search Range2.0 HzHow far from the nominal frequency to search in adaptive mode.
DetrendOnApply linear detrend to each FFT segment before windowing.
High-Pass Hz0.1High-pass filter cutoff frequency.

FFT

SettingDefaultDescription
Window FunctionHanningWindow applied to each FFT segment. Options: Hanning (best general-purpose for EEG), Hamming (slightly different sidelobe behavior), Blackman (lowest leakage, wider main lobe).

Artifact Detection

SettingDefaultDescription
Artifact DetectionOnEnable automatic artifact flagging per channel.
Threshold500.0 uV^2Total power above this value flags the channel as artifact.

Band Ranges

Each of the 7 bands (Delta, Theta, Alpha, Beta, Gamma, Mu, Custom) has configurable min/max frequency boundaries in Hz.

Coherence

SettingDefaultDescription
Coherence Pairs(empty)Specify which channel pairs to compute. Format: 0-1,0-2,1-3. Empty = all unique pairs.

Asymmetry

SettingDefaultDescription
Left Channels(empty)Comma-separated channel indices for the left hemisphere (e.g. 0,2,4).
Right Channels(empty)Comma-separated channel indices for the right hemisphere (e.g. 1,3,5). Pairs are formed by matching position: left[0]-right[0], left[1]-right[1], etc.

Output JSON Structures

Analysis Output

The Analysis port outputs a complete JSON structure with this layout:

{
  "channelCount": 8,
  "sampleRate": 16000,
  "fftSize": 65536,
  "frequencyResolution": 0.244,
  "timestamp": 1711929600.123,
  "channels": {
    "Fp1": {
      "artifact": false,
      "totalPower": 42.5,
      "dominantBand": "Alpha",
      "bands": {
        "Delta": {
          "power": 8.2,
          "relative": 0.193,
          "peakFreq": 2.5,
          "peakAmp": 1.8
        },
        "Theta": {
          "power": 5.1,
          "relative": 0.120,
          "peakFreq": 6.0,
          "peakAmp": 1.2
        },
        "Alpha": {
          "power": 15.8,
          "relative": 0.372,
          "peakFreq": 10.2,
          "peakAmp": 4.5
        },
        "Beta": {
          "power": 7.3,
          "relative": 0.172,
          "peakFreq": 18.5,
          "peakAmp": 0.8
        },
        "Gamma": {
          "power": 3.1,
          "relative": 0.073,
          "peakFreq": 40.0,
          "peakAmp": 0.3
        },
        "Mu": {
          "power": 12.0,
          "relative": 0.282,
          "peakFreq": 10.5,
          "peakAmp": 3.9
        },
        "Custom": {
          "power": 42.5,
          "relative": 1.0,
          "peakFreq": 10.2,
          "peakAmp": 4.5
        }
      }
    },
    "Fp2": { ... },
    "F3": { ... }
  }
}

Channel keys use electrode labels from the BrainBrick Device Input when available, or numeric indices ("0", "1", ...) otherwise. Channels are sorted in anatomical front-to-back order (Fp, F, C, P, T, O) for consistent output regardless of device channel ordering.

Band power fields:

  • power — Absolute band power in uV^2 (integrated PSD over band range)
  • relative — Fraction of total power (0 — 1)
  • peakFreq — Frequency of the highest PSD bin within the band, in Hz
  • peakAmp — PSD amplitude at the peak frequency, in uV^2/Hz

Total Power Output

{
  "Fp1": 42.5,
  "Fp2": 38.7,
  "F3": 51.2,
  "F4": 49.8
}

Per-channel total integrated power in uV^2. Keys in anatomical order.

Dominant Band Output

{
  "Fp1": "Alpha",
  "Fp2": "Alpha",
  "F3": "Beta",
  "F4": "Theta"
}

The name of the frequency band with the highest absolute power per channel (excluding Custom and Mu from the competition).

Spectrum Output

{
  "Fp1": [0.001, 0.002, 0.015, 0.234, ...],
  "Fp2": [0.001, 0.003, 0.012, 0.198, ...],
  "_bandRanges": [
    {"name": "Delta", "min": 0.5, "max": 4.0},
    {"name": "Theta", "min": 4.0, "max": 8.0},
    ...
  ]
}

Each channel maps to an array of PSD values (uV^2/Hz) from bin 0 (DC) to bin N/2 (Nyquist). The frequency of bin i is i x frequencyResolution. The _bandRanges metadata provides the current band boundary configuration for downstream visualization nodes (such as EEG Spectrum).

Coherence Output

{
  "Alpha": {
    "Fp1-Fp2": 0.85,
    "F3-F4": 0.72,
    "C3-C4": 0.91
  },
  "Beta": {
    "Fp1-Fp2": 0.62,
    "F3-F4": 0.55,
    "C3-C4": 0.78
  },
  "Delta": { ... },
  "Theta": { ... },
  "Gamma": { ... },
  "Mu": { ... },
  "Custom": { ... }
}

Grouped by frequency band. Each band contains magnitude-squared coherence values (0 — 1) for each channel pair. Pair keys use electrode labels when available (e.g. "Fp1-Fp2"), or indices ("0-1").

Interpreting coherence:

  • 0.0 — No linear relationship between channels at this frequency band
  • 0.5 — Moderate coupling
  • 1.0 — Perfect linear relationship (identical signals)
  • High alpha coherence between homologous electrode pairs (e.g. C3-C4) is a common healthy-brain marker
  • Reduced coherence may indicate disconnection or lesion between brain regions

Asymmetry Output

{
  "Fp1-Fp2": {
    "left": "Fp1",
    "right": "Fp2",
    "Delta": -0.05,
    "Theta": 0.12,
    "Alpha": 0.31,
    "Beta": -0.08,
    "Gamma": 0.02,
    "Mu": 0.28,
    "Custom": 0.15
  },
  "F3-F4": { ... }
}

Each pair key maps to an object containing:

  • left / right — The electrode labels for the pair
  • Per-band asymmetry index: -1.0 (left dominant) to +1.0 (right dominant), 0.0 = symmetric
  • null if both channels in the pair are artifact-flagged

Interpreting asymmetry:

  • Frontal alpha asymmetry (F3-F4, F7-F8) is widely studied as a marker of emotional valence and approach/withdrawal motivation
  • Positive alpha asymmetry (right > left) is associated with approach motivation and positive affect
  • Negative alpha asymmetry (left > right) is associated with withdrawal motivation
  • Values near 0 indicate symmetric hemispheric activity

FFT Size and Frequency Resolution

The FFT Size directly determines frequency resolution:

Frequency Resolution = Sample Rate / FFT Size
FFT SizeFreq Resolution at 16 kHzFreq Resolution at 256 HzBuffer Duration at 16 kHz
102415.625 Hz0.250 Hz0.064 s
40963.906 Hz0.0625 Hz0.256 s
163840.977 Hz0.0156 Hz1.024 s
327680.488 Hz--2.048 s
655360.244 Hz--4.096 s
1310720.122 Hz--8.192 s

For EEG analysis, a frequency resolution of 0.5 Hz or better is typically desired to resolve individual frequency bands. At 16 kHz sample rate, FFT Size 32768 (0.488 Hz resolution) or 65536 (0.244 Hz, the default) are good choices.

Trade-off: Larger FFT sizes give finer frequency resolution but require more samples before the first result (longer startup delay) and more computation time.

Architecture and Performance

Three-Phase Architecture

The node uses a carefully designed three-phase architecture to maintain 120 fps output rendering while performing computationally expensive FFT analysis:

  1. Ingestion phase (MainActor, ~50 us) — De-interleaves samples from the shared MTLBuffer and applies real-time IIR filters. Runs every frame with new data available.
  1. FFT computation phase (FFTEEGProcessor actor, ~5 ms) — Dispatched as a fire-and-forget Task. At most one FFT task runs per node at a time (guard prevents overlap). Computes Welch PSD, band powers, coherence, and asymmetry on a dedicated actor with per-channel parallelism.
  1. Result read phase (MainActor, ~0 us) — Cached FFT results are stored behind an os_unfair_lock and read synchronously with zero overhead. The output always reflects the most recently completed FFT computation.

Performance Characteristics

MetricTypical ValueNotes
Ingestion per frame~50 usDe-interleave + IIR filter, scales with delta samples x channels
FFT computation~5 msWelch PSD via GPU Metal or CPU parallel, 8 channels, 65536 FFT
Coherence computation~2 ms4096-point segments, all pairs, parallel
Result cache read~0 usLock-protected atomic read
Internal buffer per channel3x FFT size196608 samples at default settings
Memory per channel~768 KB3 x 65536 x 4 bytes

Multiple Instances

Multiple FFT EEG nodes can run simultaneously in the same graph. Each node maintains independent per-node state (ingestion buffers, filter states, FFT cache). This allows analyzing the same device data with different FFT sizes or settings, or analyzing data from different devices.

Practical EEG Analysis Tips

Getting Started

  1. Add a BrainBrick Device Input node and connect to your EEG device
  2. Add an FFT EEG node and connect the MTL Data output to its MTL Data input
  3. Wait for the Ready output to become true (a few seconds for the buffer to fill)
  4. Connect the Analysis output to a JSON Break node to inspect per-channel results
  5. Connect the Spectrum output to an EEG Spectrum visualization node

Optimizing for Real-Time BCI

  • Set Update Rate to 4 — 10 Hz to balance responsiveness with CPU usage
  • Use FFT Size 32768 for faster startup with adequate resolution
  • Disable Coherence and Asymmetry unless needed — they add significant computation
  • Monitor the inspector's performance diagnostics (ingestion time, FFT time, buffer fill %)

Interpreting Band Powers

  • Relative power (0 — 1) is often more useful than absolute power for comparisons across channels or sessions, as it normalizes for overall signal amplitude differences
  • Alpha power typically increases when the subject closes their eyes and decreases when they open them (the classic "alpha blocking" effect)
  • Beta power increases during active cognitive engagement
  • Theta/Alpha ratio is sometimes used as a drowsiness index
  • Frontal midline theta (Fz) is associated with sustained attention and working memory

Artifact Management

  • Keep the artifact threshold at 500 uV^2 for typical EEG amplitudes
  • Sudden spikes in Total Power across all channels often indicate movement artifact
  • Single-channel artifacts may indicate a loose electrode
  • The artifact flag is per-channel and per-computation — it does not reject data from the buffer, only marks the current epoch

Notch Filter Configuration

  • Use 50 Hz in Europe, Asia, and most of the world; 60 Hz in the Americas and parts of Asia (Japan, Taiwan)
  • Enable Harmonics to also remove 2nd and 3rd harmonic interference (100/120 Hz, 150/180 Hz)
  • The Adaptive Notch mode is useful when the exact powerline frequency varies (e.g. generator power) — it tracks the actual peak and adjusts the notch center frequency with EMA smoothing
  • A Q of 30 provides a narrow notch that minimally affects surrounding frequencies. Lower Q values (10 — 20) remove more interference but also attenuate more EEG signal near the notch frequency

Typical Graph Configurations

Basic EEG Analysis

BrainBrick Device Input --> FFT EEG --> JSON Break --> [per-channel band powers]
                                  --> EEG Spectrum --> Canvas

Full Analysis with Visualization

BrainBrick Device Input --> FFT EEG (Coherence On, Asymmetry On)
    Analysis --> JSON Break --> JSON Get (path: "channels.Fp1.bands.Alpha.relative") --> UI Text
    Spectrum --> EEG Spectrum --> Canvas
    Total Power --> JSON Break --> [per-channel power bars]
    Coherence --> JSON Get --> [pair coherence values]
    Asymmetry --> JSON Get --> [hemisphere asymmetry display]

Neurofeedback Loop

BrainBrick Device Input --> FFT EEG
    Analysis --> JSON Get (channels.Cz.bands.Alpha.relative) --> Compare (> 0.3) --> [reward trigger]
                                                              --> Remap (0..0.5 to 0..1) --> Circle 2D (Radius) --> Canvas

Window Functions

FunctionFrequency ResolutionSpectral LeakageBest For
HanningGoodLowGeneral-purpose EEG analysis (default). Best balance of resolution and leakage.
HammingGoodLow (slightly different sidelobe pattern)Similar to Hanning. Does not reach zero at window edges.
BlackmanReduced (wider main lobe)LowestWhen spectral leakage from strong nearby signals is a concern (e.g. strong powerline near gamma band).

For most EEG applications, Hanning is the recommended choice.

Understanding the Output Values

This section explains every value returned by the FFT EEG node in plain language, with analogies, typical ranges, and practical examples — written for users who are not deeply familiar with EEG signal processing.

Think of the equalizer in a music player — it shows how loud the bass, mid, and treble frequencies are. The FFT EEG node does the same thing with brain signals, except the frequency bands correspond to different brain states.

Why uV² (Squared) and Not Just uV?

There are two ways to measure an EEG signal:

UnitWhat it measuresAnalogy
uV (microvolts)Amplitude — how tall the signal wave isHeight of an ocean wave (cm)
uV² (microvolts squared)Power — how much energy is in the signalWave energy (height²)

Simple analogy: Think of ocean waves.

  • Amplitude (uV) = wave height, for example 10 cm.
  • Power (uV²) = wave energy, which is proportional to height squared: 10² = 100.

A basic physics law: energy is proportional to amplitude². Therefore:

  • If the signal amplitude is 5 uV then power is 25 uV²
  • If the signal amplitude is 10 uV then power is 100 uV²
  • Double the amplitude = four times the power

Why use power (uV²) instead of amplitude (uV)?

  1. The EEG signal oscillates around zero (+ and − values). If you simply summed amplitudes, positive and negative waves would cancel each other out, giving a result near zero.
  2. By squaring the amplitudes, all values become positive, and the sum truly reflects the signal's strength.
  3. This is the standard method in spectral analysis (Welch PSD), used by every EEG system worldwide.

In short: uV = "how tall the wave is", uV² = "how much energy is in the wave". The FFT EEG node works with power (energy), so you will see uV² everywhere.

Total Power — Typical Values

StateTypical valueDescription
Relaxed person, eyes closed5–30 uV²Normal EEG
Active thinking3–15 uV²Reduced alpha, increased beta
Muscle artifact100–1000+ uV²Abnormally high — artifact
Electrode fell off0.001 or lessNear zero — no signal
Sleep state20–80 uV²Increased delta/theta

Range:

  • Min: ~0.0 (no signal or very weak signal)
  • Max: theoretically unlimited, but in practice >500 uV² is almost always an artifact
  • Typical operating range: 1–50 uV²

Practical example: To control an object's size in a visualization based on overall signal strength, use totalPower with a Remap node:

  • Input: totalPower (range 1–50)
  • Output: object size (range 0.1–1.0)

Dominant Band — Brain State Mapping

ValueMeaningTypical state
"Delta"Slow waves dominate (0.5–4 Hz)Deep sleep, unconsciousness
"Theta"Theta waves dominate (4–8 Hz)Drowsiness, meditation, imagination
"Alpha"Alpha waves dominate (8–12 Hz)Relaxation with eyes closed
"Beta"Beta waves dominate (12–30 Hz)Active thinking, concentration
"Gamma"Gamma waves dominate (30–90 Hz)Intense cognitive processing
"None"Cannot determineNot enough data
Note: Mu and Custom bands are excluded from dominant band determination because Mu overlaps with Alpha, and Custom is user-defined.

Practical example: Change the background color based on the dominant band:

  • "Alpha" → green background (relaxation)
  • "Beta" → blue background (concentration)
  • "Theta" → purple background (meditation)

Band Power — Typical Ranges

BandFrequency rangeTypical power (uV²) at restWhat increases it
Delta0.5–4 Hz1–10Sleep, fatigue, brain injury
Theta4–8 Hz0.5–5Meditation, imagination, memory processes
Alpha8–12 Hz2–15Eyes closed, relaxation
Beta12–30 Hz1–8Active thinking, stress, concentration
Gamma30–90 Hz0.1–3High-level cognitive processing
Mu8–13 Hz1–10Motor rest state (disappears during movement)
Custom0.5–100 HzvariesUser-defined range

Practical example: Alpha power is the most commonly used parameter in neurofeedback:

  • Subject closes eyes → Alpha power increases from 3 to 12 uV²
  • Subject opens eyes → Alpha power drops to 2 uV²
  • Goal: teach the subject to increase Alpha power with eyes open (relaxation training)

Relative Power — Proportions

What it is: The proportion of a band's power relative to the total power. Answers the question: "What percentage of the total signal does this band make up?"

Unit: dimensionless ratio, range 0.0 to 1.0

Formula: relative = power / totalPower

ValueMeaningExample
0.0This band is not present in the signalNo alpha waves
0.1515% of the total signal is this bandNormal theta proportion
0.4040% of the total signal is this bandVery strong alpha (relaxation)
0.6060% of the total signal is this bandDominant band
1.0100% — the entire signal is this bandPractically impossible
Important: The sum of all bands' relative values is approximately 1.0 (exactly 1.0 when using only the standard non-overlapping bands).

Why relative matters: Absolute power varies between people (some naturally have a stronger signal than others). Relative power lets you compare proportions regardless of signal strength.

Peak Frequency — Individual Variability

What it is: The frequency with the highest power amplitude within the band. Answers: "Where exactly within the band is the strongest signal?"

BandpeakFreq rangeTypical valueWhat affects it
Delta0.5–4.0 Hz1.5–3.0 HzSleep depth
Theta4.0–8.0 Hz5.0–7.0 HzMeditation intensity
Alpha8.0–12.0 Hz9.5–11.0 HzIndividual Alpha Frequency (IAF)
Beta12.0–30.0 Hz14.0–22.0 HzType of thinking
Gamma30.0–90.0 Hz35.0–50.0 HzCognitive load
Mu8.0–13.0 Hz9.0–11.0 HzMotor readiness

Practical example — Individual Alpha Frequency (IAF):

Each person has their own alpha peak. One person may be at 9.5 Hz, another at 11.2 Hz. IAF is an important biomarker:

  • IAF > 10.5 Hz → Faster cognitive processing
  • IAF < 9.0 Hz → Possible cognitive slowing
  • IAF shifting left (decreasing) → Fatigue, aging
  • Use Alpha.peakFreq to track IAF in real time

Peak Amplitude — Sharp vs Diffuse Peaks

What it is: The PSD value (power spectral density) at the frequency bin where the band's maximum occurs. Shows how pronounced the peak is.

Unit: uV²/Hz

peakAmp valueMeaning
< 0.1Very weak peak — band is barely present
0.5–2.0Normal EEG peak
2.0–10.0Strong peak (e.g., strong alpha during relaxation)
> 10.0Very strong — check for artifacts

Difference between power and peakAmp:

  • power = the band's total power (width x height)
  • peakAmp = only the tallest point within the band

Think of a mountain range:

  • power = the total volume of the entire range
  • peakAmp = the highest summit
  • You can have a tall summit (peakAmp) but a narrow range (small power)
  • Or a low but very wide range (large power, small peakAmp)

Practical example: Use peakAmp to determine whether the alpha peak is "sharp" (a distinct rhythm) or "flat" (a diffuse signal):

  • Alpha.peakAmp > 3.0 and Alpha.relative > 0.3 → Clear alpha rhythm (good relaxation state)
  • Alpha.peakAmp < 0.5 but Alpha.power > 2.0 → Diffuse signal in the alpha band (no distinct rhythm)

Coherence — Interpreting Synchronization

ValueMeaning
0.0Completely unsynchronized — channels operate independently
0.3Weak coherence
0.5Moderate coherence
0.7High coherence — channels are functionally connected
1.0Perfect synchronization (practically impossible in biological signals)

Practical example: Alpha coherence between frontal channels (F3–F4) can indicate:

  • High (>0.6): Frontal symmetry — emotional balance
  • Low (<0.3): Frontal asymmetry — possible risk of depression

Asymmetry — Hemispheric Balance

ValueMeaning
-1.0Complete left-side dominance
-0.3Moderate left dominance
0.0Symmetric signal
+0.3Moderate right dominance
+1.0Complete right-side dominance

Practical example — Frontal Alpha Asymmetry (FAA):

  • FAA > 0 (right > left alpha) → Positive emotions, approach motivation
  • FAA < 0 (left > right alpha) → Negative emotions, withdrawal motivation
  • Used in depression and emotional state research
Note: If both channels in a pair are flagged as artifacts, band values are set to null. If only one channel is an artifact, the AI is still calculated normally. If the combined power of both channels is very small (< 1e-10 uV²), AI = 0 (symmetric).

Quick Reference — Typical Value Scenarios

Scenario: Person sitting quietly with eyes closed

ParameterFp1 (Frontal)O1 (Occipital)
totalPower15 uV²25 uV²
dominantBand"Alpha""Alpha"
Alpha.power4.5 uV²12.0 uV²
Alpha.relative0.300.48
Alpha.peakFreq10.25 Hz10.25 Hz
Alpha.peakAmp1.5 uV²/Hz4.8 uV²/Hz
Beta.power3.2 uV²1.8 uV²
Beta.relative0.210.07
artifactfalsefalse
Note: Alpha is stronger in occipital channels (O1, O2) than in frontal channels (Fp1, Fp2) — this is normal.

Scenario: Person actively solving a math problem

ParameterFp1 (Frontal)O1 (Occipital)
totalPower10 uV²12 uV²
dominantBand"Beta""Beta"
Alpha.power1.2 uV²2.5 uV²
Alpha.relative0.120.21
Beta.power4.8 uV²3.9 uV²
Beta.relative0.480.33
Beta.peakFreq18.5 Hz16.1 Hz
Note: Beta is higher in frontal channels (thinking), Alpha has decreased (eyes open, active state).

Useful Formulas for Neurofeedback and BCI

Theta/Beta Ratio (Attention Indicator)

TBR = Theta.power / Beta.power
RatioMeaning
> 3.0Risk of attention deficit
1.5–2.5Normal resting state
< 1.0High concentration
Note on relative values: The relative value itself is always between 0.0 and 1.0 (it is a proportion). But if you divide one relative by another, the result can exceed 1.0. Example: if Theta.relative = 0.30 and Beta.relative = 0.10, then ratio = 0.30 / 0.10 = 3.0. This means there is 3x more energy in the Theta band than in the Beta band.

Alpha Ratio (Relaxation Indicator)

Alpha_ratio = Alpha.relative
ValueMeaning
> 0.35Deep relaxation
0.15–0.35Normal calm
< 0.10Active/stressed state

Engagement Index

EI = Beta.power / (Alpha.power + Theta.power)
ValueMeaning
> 1.0High engagement
0.5–1.0Moderate engagement
< 0.5Low engagement, drowsiness

Spectrum Data — How to Use the Raw PSD Array

Each channel in the Spectrum output contains a float array with halfN elements (e.g., 32768 elements with FFT Size = 65536). Each element is the power spectral density at a specific frequency.

The array index corresponds to a frequency:

frequency_Hz = index x frequencyResolution

Example (16000 Hz sample rate, 65536 FFT size, frequencyResolution = 0.244 Hz):

Array indexFrequency (Hz)Typical PSD valueWhat is happening there
00 Hz (DC)~0Empty (DC removed)
10.24 Hz0.005Very low frequency
204.88 Hz0.15Theta range
4110.01 Hz2.30Alpha peak
8019.53 Hz0.08Beta range
20048.83 Hz0.001Higher frequencies, very little power
327677999.8 Hz~0.0Near Nyquist frequency

PSD Value Ranges

PSD value (uV²/Hz)Meaning
< 0.01Very low power — background noise
0.01–0.5Normal EEG activity
0.5–5.0Pronounced band peak (e.g., alpha rhythm)
5.0–50.0Very strong signal — check for artifacts
> 50.0Almost certainly an artifact

Practical Uses for Raw Spectrum Data

  1. Spectrogram: Store PSD arrays over time to build a 2D color map where X = time, Y = frequency, color = power. This is a "brain activity heat map".
  2. Individual frequency analysis: To know the exact power at 10.0 Hz: index = 10.0 / 0.244 = 41, then power_at_10Hz = Spectrum["Fp1"][41].
  3. Custom band definition: Use the Spectrum data to compute your own band sum: my_band_power = sum(Spectrum[i]) x 0.244 where i covers your desired frequency range.
  4. EEG Spectrum visualization: Connect the Spectrum output directly to an EEG Spectrum node, which renders it as a frequency graph.

Technical Parameters Summary

ParameterValueNote
Sample Rate16000 HzFrom BrainBrick device
FFT Size65536 (default)Range: 1024–131072
Frequency Resolution~0.244 Hz= 16000/65536
Nyquist Frequency8000 Hz= 16000/2
Welch Segments~3–24Depends on buffer size
Overlap50% (default)Adjustable 0–90%
Window FunctionHanning (default)Options: Hanning, Hamming, Blackman
Computation EngineMetal GPU~2 ms on Apple Silicon
Update Rate0 Hz (default)Every frame; increase to limit

A ready-made example project for this node is built into Grafit Pro: select the node in the library and open or drag the example from its description panel.

Open FFT EEG in the interactive catalog →

FFT EEG is one of 381 nodes in Grafit Pro.

Free download. Every feature for 7 days, no card. Then €99.99 once — or keep playing your projects as a Player.

More Filter nodes