mne.io.set_eeg_reference

mne.io.set_eeg_reference(inst, ref_channels=None, copy=True)

Rereference EEG channels to new reference channel(s).

If multiple reference channels are specified, they will be averaged. If no reference channels are specified, an average reference will be applied.

Parameters:

inst : instance of Raw | Epochs | Evoked

Instance of Raw or Epochs with EEG channels and reference channel(s).

ref_channels : list of str | None

The names of the channels to use to construct the reference. If None is specified here, an average reference will be applied in the form of an SSP projector. If an empty list is specified, the data is assumed to already have a proper reference and MNE will not attempt any re-referencing of the data. Defaults to an average reference (None).

copy : bool

Specifies whether the data will be copied (True) or modified in place (False). Defaults to True.

Returns:

inst : instance of Raw | Epochs | Evoked

Data with EEG channels re-referenced.

ref_data : array

Array of reference data subtracted from EEG channels.

See also

set_bipolar_reference
Convenience function for creating bipolar references.

Notes

  1. If a reference is requested that is not the average reference, this function removes any pre-existing average reference projections.
  2. During source localization, the EEG signal should have an average reference.
  3. In order to apply a reference other than an average reference, the data must be preloaded.

New in version 0.9.0.