mne.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.


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 (default), an average reference will be added as an SSP projector but not immediately applied to the data. 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.


inst : instance of Raw | Epochs | Evoked

Data with EEG channels re-referenced. For ref_channels=None, an average projector will be added instead of directly subtarcting data.

ref_data : array

Array of reference data subtracted from EEG channels. This will be None for an average reference.

See also

Convenience function for creating bipolar references.


  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.