Filter node

Impedance

Real-time electrode contact quality monitor for EEG systems. Two measurement modes: LOFF (true kΩ via ADS1299 AC lead-off excitation) and Signal Quality (passive noise-proxy estimation without current injection). GPU-accelerated Goertzel analysis with color-coded bar chart visualization and per-electrode quality classification.

Inputs

PortTypeDefault
EnableOff stops measuring, forgets the running averages and reports the electrodes as not all good.booltrue
EEG DataThe raw EEG stream to measure. Cable it from an EEG device or simulator node; without it the bars stay empty.structure—
ModeSignal Quality estimates contact from noise and mains hum with no current injected, LOFF reads true kΩ but needs the excitation firmware and pollutes the raw EEG. Anything outside the two falls back to Signal Quality.int1
Mains HzYour local power-line frequency, so hum pickup can be measured in the right band — 50 in Europe, 60 in the Americas. Only the ±2 Hz band around it is examined.float50.0
XHorizontal centre of the bar chart, in Grafit units where the shorter screen edge spans -1…1. Not limited.float0
YVertical centre of the bar chart, in Grafit units. Not limited.float0
WidthWidth of the bar chart in Grafit units; the channels share it evenly. Not limited, but 2 fills the shorter screen edge.float2.0
HeightHeight of the bar chart in Grafit units. Not limited; below about 0.1 the labels crowd the bars.float0.5
Show LabelsDraws the electrode names under the bars and the unit above them. Off also frees the margins, so the bars grow wider.booltrue
Label SizeText size for the labels, in points; the value readouts use 85 percent of it. Not limited, but 9…18 keeps the chart readable.float12.0
Good ThresholdBelow this the contact counts as good and the bar turns green. In kΩ for LOFF, in the same scale for Signal Quality; around 10 is the usual gel-electrode target.float100.0
Bad ThresholdAt or above this the contact counts as bad and the bar turns red, with the span between the thresholds shown as marginal. Always kept at least 1 above Good Threshold.float500.0
WindowHow many seconds of signal each measurement looks at. Longer is steadier but slower to react; anything beyond what the ring buffer holds is trimmed to its length.float1.0

Outputs

PortType
Imageimage
WidthWidth of the bar chart in Grafit units; the channels share it evenly. Not limited, but 2 fills the shorter screen edge.float
HeightHeight of the bar chart in Grafit units. Not limited; below about 0.1 the labels crowd the bars.float
Impedancesjson
All Goodbool

How It Works

The Impedance node monitors electrode contact quality in real time, helping you ensure reliable EEG signal acquisition before and during recording sessions. It reads raw data from the EEG device’s shared Metal buffer and computes per-channel impedance or quality metrics.

BrainBrick Device Input → MTL Data → Impedance → Image → Canvas

Two Measurement Modes

The node supports two fundamentally different approaches to impedance measurement:

ModeMethodOutput UnitRequires
LOFF (kΩ)ADS1299 AC lead-off excitation at fDR/4kΩ (true impedance)Firmware ENABLE_IMPEDANCE_LOFF = 1
Signal QualityPassive noise analysis (thermal noise + mains hum)SQI 0–100 (quality score)No firmware changes needed
RecommendationUse Signal Quality mode (default) for most applications. It works without LOFF excitation, does not pollute the raw EEG spectrum, and provides an intuitive 0–100 quality score. Use LOFF mode only when you need absolute kΩ measurements for clinical-grade electrode verification.

Signal Quality Mode

Signal Quality mode estimates electrode contact quality from the noise characteristics of each channel — without injecting any excitation current. This is the default and recommended mode for most EEG applications.

How It Works

The fundamental principle: poorly connected electrodes have higher impedance, which amplifies both thermal noise and mains interference. The node measures three independent metrics per channel:

MetricFrequency RangeWhat It Measures
High-band RMS70–200 HzThermal noise (Johnson–Nyquist). Proportional to √Z. Measured above the EEG content band, below Nyquist/2.
Mains hum ratio50 or 60 HzPowerline interference pickup. Higher impedance electrodes act as better antennas for mains hum.
Broadband RMSFull bandReference signal level for mains ratio normalization.

Signal Quality Index (SQI)

The three metrics are combined into a single score from 0 to 100:

ScoreMeaningTypical Cause
80–100Excellent contact (green)Well-applied wet gel electrode, <5 kΩ
40–80Marginal contact (yellow)Drying gel, loose contact, dry electrode
0–40Poor contact (red)No gel, electrode not touching skin
0Disconnected (grey)ADC saturation detected (>50% samples at rail)

GPU Acceleration

All six Goertzel frequency filters (5 high-band + 1 mains) run in parallel per channel via a Metal compute kernel. A single pass over the ring buffer computes all metrics simultaneously. GPU acceleration reduced computation time from 2.13 ms to 0.39 ms (5.5× speedup).

Mains frequencySet the Mains Hz input to match your power grid: 50.0 for Europe/Asia, 60.0 for North/South America. The node uses this to tune the mains hum Goertzel filter.

LOFF Mode

LOFF mode uses the ADS1299’s built-in AC lead-off detection circuit for true impedance measurement in kiloohms.

How It Works

The ADS1299 ADC injects a small AC excitation current at fDR/4 (500 Hz at 2 kSPS) through each electrode. The Impedance node then:

1
Goertzel DFT

Extracts the amplitude of the 500 Hz excitation signal per channel using a single-frequency Goertzel filter. GPU-accelerated: all channels processed in parallel via Metal compute shader.

2
Ohm’s Law

Converts the measured voltage to impedance: . The firmware uses 24 nA peak excitation current (ILEAD_OFF_24nA setting).

3
EMA Smoothing

Exponential moving average (α = 0.92, ~0.6 s time constant) prevents flickering while remaining responsive to cable changes.

4
Quality Classification

Each channel is classified as good, marginal, bad, or disconnected based on the configurable Good/Bad thresholds.

ImportantLOFF mode requires the firmware setting ENABLE_IMPEDANCE_LOFF = 1. The excitation current adds a 500 Hz signal to the raw EEG data, which will appear in spectral analysis. Disable LOFF before recording clean EEG data.

Quality Classification

Both measurement modes use the same color-coded quality classification system. Thresholds are configurable via the Good Threshold and Bad Threshold inputs.

QualityColorLOFF ConditionSignal Quality Condition
Good GreenZ < Good ThresholdSQI > Good Threshold
Marginal YellowGood ≤ Z < Bad ThresholdBad Threshold ≤ SQI < Good Threshold
Bad RedZ ≥ Bad ThresholdSQI < Bad Threshold
Disconnected RedADC saturation detected (>50% of samples at 95% of 24-bit max)
Dead GreyHardware fault or shorted channel (no signal)

Output: Impedances (JSON)

The Impedances output port provides per-electrode values as an OrderedJSON object with anatomical electrode ordering:

// LOFF mode (kΩ):
{"Fp1": 4.2, "Fp2": 3.8, "C3": 12.1, "C4": 8.7, "P3": 5.4, "P4": 6.2, "O1": 45.3, "O2": 7.1}

// Signal Quality mode (SQI 0–100):
{"Fp1": 92, "Fp2": 95, "C3": 67, "C4": 78, "P3": 88, "P4": 91, "O1": 12, "O2": 85}

Output: All Good (Bool)

The All Good output is true when every electrode is classified as “good”. Use this as a gate signal to start recordings only when all electrodes are properly connected.

Impedance → All Good → Compare → SetVariable (Recording Allowed)

Settings Reference

Measurement

ParameterDefaultDescription
ModeSignal QualityMeasurement mode: 0 = LOFF (kΩ), 1 = Signal Quality (SQI)
Mains Hz50.0Powerline frequency: 50 Hz (Europe/Asia) or 60 Hz (Americas)
Window1.0Analysis window in seconds. Longer = smoother, shorter = more responsive.
Good Threshold10.0Threshold for “good” classification (kΩ in LOFF, SQI in Signal Quality)
Bad Threshold50.0Threshold for “bad” classification

Display

ParameterDefaultDescription
X, Y0, 0Position in Grafit coordinates
Width2.0Width of the bar chart display
Height0.5Height of the bar chart display
Show LabelstrueDisplay electrode names and value labels
Label Size12.0Font size for electrode labels

Typical Graph Configurations

Pre-Recording Electrode Check

Monitor electrode quality before starting an EEG recording session:

BrainBrick Device Input ├─ MTL Data → Impedance → Image → Canvas (Layer 2) └─ MTL Data → EEG Plot → Image → Canvas (Layer 1)

Quality-Gated Recording

Only allow recording when all electrodes show good contact:

Impedance → All Good → Logic (AND) Keyboard (R key) → Just Pressed → Logic (AND) → SetVariable (Record)

Per-Electrode Impedance Routing

Extract individual electrode values for custom processing:

Impedance → Impedances → JSON Get (Path: "Fp1") → Compare → DMX Sender
TipPlace the Impedance bar chart on a higher Canvas layer (e.g., Layer 2) above the EEG Plot (Layer 1) so you can monitor both raw waveforms and electrode quality simultaneously.

Performance

GPU Acceleration

Both LOFF and Signal Quality modes use Metal compute shaders for parallel processing across all channels. The GPU performs the numerically intensive Goertzel DFT filtering, while lightweight score computation runs on the CPU.

MetricValueNotes
Compute rate25 HzThrottled to avoid 60 fps overhead. ~2 of every 3 frames use cached output.
LOFF GPU time< 0.3 msSingle Goertzel filter per channel, all channels parallel
Signal Quality GPU time0.39 ms6 Goertzel filters per channel, single ring buffer pass
EMA smoothingα = 0.92~0.6 s time constant, prevents visual flickering
Channel support1–32Scales with device electrode count
CPU fallbackIf the Metal compute shader is unavailable, the node falls back to sequential CPU Goertzel computation. This is functionally identical but slower on systems with many channels.

Open Impedance in the interactive catalog →

Impedance 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