Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
b8cb797
DOC: Clarify add_reference_channels usage with average reference
Dpereaptkhamur-13 Apr 8, 2026
e270d35
DOC: take over #13664 to clarify avg behavior and add towncrier
Dpereaptkhamur-13 Apr 16, 2026
5ecd0c0
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 16, 2026
f261a66
Merge branch 'main' into doc-ref-channel-clarification
Dpereaptkhamur-13 Apr 16, 2026
2231721
Merge branch 'main' into doc-ref-channel-clarification
Dpereaptkhamur-13 Apr 19, 2026
e110c7c
DOC: move and reformat avg ref note
Dpereaptkhamur-13 Apr 22, 2026
922c26f
Merge branch 'doc-ref-channel-clarification' of https://github.com/Dp…
Dpereaptkhamur-13 Apr 22, 2026
d39b245
Merge branch 'main' into doc-ref-channel-clarification
Dpereaptkhamur-13 Apr 22, 2026
c3ecfd2
DOC: address review - add sensor-space detail and citation
Dpereaptkhamur-13 Apr 23, 2026
2bef1d5
Merge branch 'doc-ref-channel-clarification' of https://github.com/Dp…
Dpereaptkhamur-13 Apr 23, 2026
dbee994
DOC: expand tutorial note to match sensor-space detail
Dpereaptkhamur-13 Apr 23, 2026
f26d305
DOC: remove irrelevant note from add_reference_channels
Dpereaptkhamur-13 Apr 23, 2026
effcec1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 23, 2026
7319a6d
Merge branch 'main' into doc-ref-channel-clarification
Dpereaptkhamur-13 May 1, 2026
a2eb16c
Update mne/utils/docs.py
Dpereaptkhamur-13 May 1, 2026
d6839bb
Update mne/utils/docs.py
Dpereaptkhamur-13 May 1, 2026
cbb0596
DOC: remove blank lines
Dpereaptkhamur-13 May 1, 2026
0d98056
DOC: fix citation details and alphabetize bibliography
Dpereaptkhamur-13 May 1, 2026
87cd94f
MAINT: update changelog name and text
Dpereaptkhamur-13 May 1, 2026
2b24fca
DOC: fix bibliography location, authors, and duplicate DOI
Dpereaptkhamur-13 May 3, 2026
2f33978
DOC: fix indentation in tutorial note
Dpereaptkhamur-13 May 3, 2026
6e49874
Update doc/changes/dev/13846.other.rst
Dpereaptkhamur-13 May 3, 2026
2549205
Merge branch 'main' into doc-ref-channel-clarification
Dpereaptkhamur-13 May 3, 2026
ec318e6
MAINT: add Deep Kaur to names.inc
Dpereaptkhamur-13 May 3, 2026
03a3501
Merge branch 'doc-ref-channel-clarification' of https://github.com/Dp…
Dpereaptkhamur-13 May 3, 2026
b2952b4
Add original PR author to changelog
tsbinns May 7, 2026
2428efb
Update wording
tsbinns May 7, 2026
5d8f145
Fix incorrect reference info
tsbinns May 7, 2026
aa51d8b
Merge branch 'main' into doc-ref-channel-clarification
tsbinns May 7, 2026
1461cef
Add original PR author [skip actions][skip azp]
tsbinns May 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/changes/dev/13846.other.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add notes to :func:`~mne.set_eeg_reference` and :ref:`_tut-set-eeg-ref` about the correct procedure to create an average reference, by :newcontrib:`Deep Kaur` and :newcontrib:`Farzah11`.
2 changes: 2 additions & 0 deletions doc/changes/names.inc
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
.. _David Haslacher: https://github.com/davidhaslacher
.. _David Julien: https://github.com/Swy7ch
.. _David Sabbagh: https://github.com/DavidSabbagh
.. _Deep Kaur: https://github.com/Dpereaptkhamur-13
.. _Demetres Kostas: https://github.com/kostasde
.. _Denis Engemann: https://denis-engemann.de
.. _Dev Parikh: https://github.com/devparikh0506
Expand Down Expand Up @@ -100,6 +101,7 @@
.. _Ezequiel Mikulan: https://github.com/ezemikulan
.. _Fahimeh Mamashli: https://github.com/fmamashli
.. _Famous077: https://github.com/Famous077
.. _Farzah11: https://github.com/Farzah11
.. _Farzin Negahbani: https://github.com/Farzin-Negahbani
.. _Federico Raimondo: https://github.com/fraimondo
.. _Federico Zamberlan: https://github.com/fzamberlan
Expand Down
10 changes: 10 additions & 0 deletions doc/references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,16 @@ @article{KhanEtAl2018
year = {2018}
}

@article{KimEtAl2023,
author = {Kim, Hyeonseok and Luo, Justin and Chu, Shannon and Cannard, Cedric and Hoffmann, Sven and Miyakoshi, Makoto},
doi = {10.3389/frsip.2023.1064138},
journal={Frontiers in Signal Processing},
pages = {1064138},
title={{ICA}’s bug: How ghost {IC}s emerge from effective rank deficiency caused by {EEG} electrode interpolation and incorrect re-referencing},
volume = {3},
year = {2023},
}
Comment thread
Dpereaptkhamur-13 marked this conversation as resolved.

@article{KingDehaene2014,
author = {King, Jean-Rémi and Dehaene, Stanislas},
doi = {10.1016/j.tics.2014.01.002},
Expand Down
7 changes: 7 additions & 0 deletions mne/utils/docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4145,6 +4145,13 @@ def _reflow_param_docstring(docstring, has_first_line=True, width=75):
EEG signal by setting ``ref_channels='average'``. Bad EEG channels are
automatically excluded if they are properly set in ``info['bads']``.

.. note::
When performing average referencing in sensor-space analyses, the original reference
electrode should be present as a zero-filled channel. If it is not, this must first
be added using :func:`~mne.add_reference_channels`, before calling
:func:`~mne.set_eeg_reference`. This is necessary to avoid biasing the reference
:footcite:`KimEtAl2023`.

- A single electrode:
Set ``ref_channels`` to a list containing the name of the channel that
will act as the new reference, for example ``ref_channels=['Cz']``.
Expand Down
11 changes: 11 additions & 0 deletions tutorials/preprocessing/55_setting_eeg_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,17 @@
raw_avg_ref = raw.copy().set_eeg_reference(ref_channels="average")
raw_avg_ref.plot()

# %%
# .. note::
# When performing average referencing in sensor-space analyses, the original reference
# electrode should be present as a zero-filled channel. If it is not, this must first
# be added using :func:`~mne.add_reference_channels`, before calling
# :func:`~mne.set_eeg_reference`. This is necessary to avoid biasing the reference
# :footcite:`KimEtAl2023`, as the subtracted reference signal would be divided by
# `n_channels` instead of the correct `n_channels + 1` (i.e., including the original
# reference channel).
#

# %%
# .. _section-avg-ref-proj:
#
Expand Down