Amplitude bouncing when re-referencing

raw.set_eeg_reference("average", projection=False)
raw.filter(0.5, 80)
raw.notch_filter(freqs=60)

ica = mne.preprocessing.ICA(
    n_components=raw.info['nchan'], max_iter="auto", random_state=97
)
ica.fit(raw)

I understand that when preprocessing eeg, bad channels are removed after filtering. If do that, it will end up with a situation where the amplitude jumps as shown in the picture. If apply ica and drop the bad channel, it comes out fine when plotting raw. What’s the problem?

It looks like a scaling issue. MNE expects data in SI units, i.e. Volts for EEG.

Mathieu

It’s not a scale issue. It is done in microvolt units.

It is done in microvolt units.

SI unit is Volt, not microvolts.

Can you do raw.get_data(picks="eeg")[0, :20] and give the values you get here?

Also, all browser accept the scalings argument to control the scaling and the +/- keys on the keyboard to interactively change the scale. That plot with vertical lines is definitely badly scaled… Run with scalings="auto" or press the - key.

Mathieu

1 Like

image
When done without re-referencing, it works well without unit problems.

That array is definitely not EEG in Volts, but it’s neither EEG in uV…
Maybe one of the channels used in the average re-referencing should not be used? e.g. maybe you have a BIP/ECG/EOG or whatever else channel which type should be first changed from 'eeg' to the appropriate type for this channel with raw.set_channel_types?

image

The picture above is the filtered signal before re-reference. It’s a microvolt. The picture below is re-referenced after the drop channel.

image

The magnitude after re-referencing is off. I assume that there’s at least one channel in your data that is problematic, and the referencing action pollutes the data across all other channels.

1 Like

So, is it okay to re-reference, filter, perform ICA, and drop the channel at the end? In this case it comes out fine.

Before re-referencing, have a look to your data and find the channel which has an abnormal amplitude. Either it’s an EEG channel, in which case mark it as bad. Or it’s not an EEG channel but has the type 'eeg', in which case correct the type with raw.set_channel_types.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.