braindecode.preprocessing.RemoveCommonAverageReference#

class braindecode.preprocessing.RemoveCommonAverageReference(*, can_change_duration=False, record_orig_chanlocs=False, force_dtype=None)[source]#

Subtracts the common average reference from the EEG data (EEGPrep version). This is useful for having a consistent referencing scheme across recordings (cf. [Offner1950]).

Generally, common average re-referencing is data -= mean(data, axis=0), but both EEGLAB/eegprep and to a greater extent MNE have additional bookkeeping around re-referencing, in the latter case due to its focus on source localization. This will have little effect on most machine-learning use cases; nevertheless, this operation is included here to allow users to mirror the behavior of the end-to-end EEGPrep pipeline by means of individual operations (for example when migrating from one to the other form) without introducing perhaps unexpected side effects on the MNE data structure.

The operation performed is:

\[X'_{c,t} = X_{c,t} - \frac{1}{C}\sum_{c=1}^{C} X_{c,t}\]

where \(C\) is the number of channels, \(c\) indexes the channel, and \(t\) indexes time.

References

[Offner1950]

Offner, F. F. (1950). The EEG as potential mapping: the value of the average monopolar reference. Electroencephalography and Clinical Neurophysiology, 2(2), 213-214.

Methods

apply_eeg(eeg, raw)[source]#

Apply the preprocessor to an EEGLAB EEG structure.

Return type:

dict[str, Any]