Mne-python: What does set_eeg_reference() do?

Created on 26 Jun 2017  路  4Comments  路  Source: mne-tools/mne-python

Hi all,

I'm a bit puzzled as to what set_eeg_reference() actually does.

Here is a gist where I do set_eeg_reference(ref_channels=[]) (as my data was already referenced).

https://gist.github.com/nbara/972eefa4a62fd6ef9df308b76ffa2559

Contrary to my expectations, this seems to rereference to the mean, and also appears to include the STIM channel in the mix (visible peaks every .5 seconds)??

Most helpful comment

Turns out, the unit test for this case was broken. This allowed me to at some point introduce a breaking change to the set_eeg_reference() function. My apologies.

All 4 comments

Based on the docstring it seems like doing [] should indeed not affect the data, but clearly it did. So I think this is a bug.

Can you take a minute to use np.random.RandomState(0).randn(...) as the data to turn this into a minimal example?

Are you up for digging into the code to try to fix it?

Hi Eric,

Here's a minimal example using random data:
https://gist.github.com/nbara/8e6e2a3dbb18675b7b57fca3fbfbc111

Does that work?

I'm afraid I have too much on my plate atm so I won't be able to fix this myself...

What the.... the referencing function should not be doing that. ok, I'm looking into it.

Turns out, the unit test for this case was broken. This allowed me to at some point introduce a breaking change to the set_eeg_reference() function. My apologies.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cbrnr picture cbrnr  路  43Comments

kingjr picture kingjr  路  36Comments

kingjr picture kingjr  路  35Comments

jona-sassenhagen picture jona-sassenhagen  路  33Comments

mmagnuski picture mmagnuski  路  43Comments