BridgedElectrodes
Namespace: RTPROCESSINGLIB · Library: DSP Library
This page documents a header-level module — a collection of free functions that share an algorithmic topic. There is no enclosing C++ class; the functions live directly in the library namespace.
mne.preprocessing.compute_bridged_electrodes in MNE-Python.
#include <dsp/bridged_electrodes.h>
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2026 MNE-CPP Authors.
Two EEG electrodes are said to be bridged when conductive paste, sweat or skin abrasion creates a low-impedance shortcut between them; the recorded signals then become near-identical and any subsequent source localisation is biased. Following Tenke & Kayser (2001, Clin. Neurophysiol. 112) the detector computes the Electrical Distance — the time-domain variance of the difference signal — for every channel pair, and flags pairs whose normalised distance falls below a user-defined threshold (default 0.3).
The implementation operates on the raw broadband signal; no rereferencing or filtering is required up-front. Output is a list of ``(i, j) channel- index pairs that the caller can mark bad, interpolate, or pass into the SSS bad-channel set.
Functions
computeElectricalDistance(data, info)
Eigen::MatrixXd computeElectricalDistance(const Eigen::MatrixXd & data, const [FiffInfo](/docs/api/fiff/fiff-info) & info);
Compute electrical distance matrix between EEG channels.
Electrical distance is defined as the standard deviation of the difference signal between two channels, normalised by the geometric mean of their individual standard deviations. Bridged electrodes will have near-zero electrical distance.
Parameters:
-
data : const Eigen::MatrixXd & Data matrix (n_channels x n_times).
-
info : const FiffInfo & FiffInfo with channel types.
Returns:
- Eigen::MatrixXd — Electrical distance matrix (n_eeg x n_eeg), with EEG channel indices stored in the order they appear in info.
computeBridgedElectrodes(data, info, params)
QList< QPair< int, int > > computeBridgedElectrodes(const Eigen::MatrixXd & data, const [FiffInfo](/docs/api/fiff/fiff-info) & info, const BridgedElectrodeParams & params);
Detect bridged EEG electrodes.
Finds pairs of EEG channels whose electrical distance falls below the threshold, indicating a physical or gel bridge.
Parameters:
-
data : const Eigen::MatrixXd & Data matrix (n_channels x n_times).
-
info : const FiffInfo & FiffInfo with channel types.
-
params : const BridgedElectrodeParams & Detection parameters.
Returns:
- QList< QPair< int, int > > — List of bridged electrode pairs as (channel_index_1, channel_index_2) using indices into info.chs.
Authors of this file
- Christoph Dinh <christoph.dinh@mne-cpp.org>