v2.0.0
Loading...
Searching...
No Matches
eeg_reference.h File Reference

EEG re-referencing operators — common-average, single-electrode and REST. More...

#include "dsp_global.h"
#include <QStringList>
#include <Eigen/Core>
Include dependency graph for eeg_reference.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  FIFFLIB
 FIFF file I/O, in-memory data structures and high-level readers/writers.
namespace  UTILSLIB
 Shared utilities (I/O helpers, spectral analysis, layout management, warp algorithms).

Functions

DSPSHARED_EXPORT void UTILSLIB::setEegReference (Eigen::MatrixXd &data, const FIFFLIB::FiffInfo &info, const QStringList &refChannels=QStringList(), bool projection=false)
 Re-reference EEG channels to average, specific channel(s), or REST.
DSPSHARED_EXPORT void UTILSLIB::addReferenceChannels (Eigen::MatrixXd &data, FIFFLIB::FiffInfo &info, const QStringList &chNames)
 Add reference channel(s) back as zero-filled rows.
DSPSHARED_EXPORT void UTILSLIB::setBipolarReference (Eigen::MatrixXd &data, FIFFLIB::FiffInfo &info, const QStringList &anodes, const QStringList &cathodes, bool dropOriginals=true)
 Create bipolar derivations from EEG channels.

Detailed Description

EEG re-referencing operators — common-average, single-electrode and REST.

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2026 MNE-CPP Authors

Author
Christoph Dinh chris.nosp@m.toph.nosp@m..dinh.nosp@m.@mne.nosp@m.-cpp..nosp@m.org
Since
2.2.1
Date
May 2026

Every EEG measurement is implicitly a potential difference between an active electrode and a reference; changing that reference is therefore a linear operation on the data matrix. The functions in this header build and apply the most widely used reference operators: subtraction of a single electrode (or the average of a few), the common-average reference (CAR), and — where a forward model is supplied — the reference electrode standardisation technique (REST) which projects the data to the equivalent reference at infinity.

Re-referencing is implemented as a single matrix multiplication so that channel covariances and inverse operators remain valid after re- referencing, provided the same operator is also applied to the noise covariance.

Definition in file eeg_reference.h.