Specify which reference to use for EEG data.
Use this function to explicitly specify the desired reference for EEG. This can be either an existing electrode or a new virtual channel. This function will re-reference the data according to the desired reference.
Note that it is also possible to re-reference the signal using a
Laplacian (LAP) “reference-free” transformation using the
compute_current_source_density() function.
Raw | Epochs | EvokedInstance of Raw or Epochs with EEG channels and reference channel(s).
list of str | strCan be:
The name(s) of the channel(s) used to construct the reference.
'average' to apply an average reference (default)
'REST' to use the Reference Electrode Standardization Technique
infinity reference [1].
An empty list, in which case MNE will not attempt any re-referencing of the data
Specifies whether the data will be copied (True) or modified in-place (False). Defaults to True.
If ref_channels='average' this argument specifies if the
average reference should be computed as a projection (True) or not
(False; default). If projection=True, the average reference is
added as a projection and is not applied to the data (it can be
applied afterwards with the apply_proj method). If
projection=False, the average reference is directly applied to
the data. If ref_channels is not 'average', projection
must be set to False (the default in this case).
list of str | strThe name of the channel type to apply the reference to.
Valid channel types are 'auto', 'eeg', 'ecog', 'seeg',
'dbs'. If 'auto', the first channel type of eeg, ecog, seeg or dbs
that is found (in that order) will be selected.
New in version 0.19.
Forward | NoneForward solution to use. Only used with ref_channels='REST'.
New in version 0.21.
str | int | NoneControl verbosity of the logging output. If None, use the default
verbosity level. See the logging documentation and
mne.verbose() for details. Should only be passed as a keyword
argument.
Raw | Epochs | EvokedData with EEG channels re-referenced. If ref_channels='average' and
projection=True a projection will be added instead of directly
re-referencing the data.
arrayArray of reference data subtracted from EEG channels. This will be
None if projection=True or ref_channels='REST'.
See also
mne.set_bipolar_referenceConvenience function for creating bipolar references.
Notes
Some common referencing schemes and the corresponding value for the
ref_channels parameter:
A new virtual reference electrode is created by averaging the current
EEG signal by setting ref_channels='average'. Bad EEG channels are
automatically excluded if they are properly set in info['bads'].
Set ref_channels to a list containing the name of the channel that
will act as the new reference, for example ref_channels=['Cz'].
A new virtual reference electrode is created by computing the average
of the current EEG signal recorded from two or more selected channels.
Set ref_channels to a list of channel names, indicating which
channels to use. For example, to apply an average mastoid reference,
when using the 10-20 naming scheme, set ref_channels=['M1', 'M2'].
The given EEG electrodes are referenced to a point at infinity using the
lead fields in forward, which helps standardize the signals.
If a reference is requested that is not the average reference, this function removes any pre-existing average reference projections.
During source localization, the EEG signal should have an average reference.
In order to apply a reference, the data must be preloaded. This is not
necessary if ref_channels='average' and projection=True.
For an average or REST reference, bad EEG channels are automatically
excluded if they are properly set in info['bads'].
New in version 0.9.0.
References
mne.set_eeg_reference#