By default, MNE seems to add an average reference projection to the raw data. I then noticed that when computing an eye blink EOG projection (using compute_proj_eog) the average reference projection gets applied prior to the computation of the projection. However, my intuition would be that you would not want to apply the average reference projection first because it will attenuate the eye blink artifacts and consequently make the periods where you estimate the eye blink noise subspace relatively less dominated by the eye blinks. Is there a recommended ordering to computing and applying these projections?
You are indeed correct. Average reference will not only attenuate the eye
blink but may also spread it to other sensors. Therefore, it is probably
better to apply it after eye blinks have been removed. The average
reference is probably added by default while plotting the raw data. Do you
have the problem even when you remove the proj using raw.del_proj() and
turn off add_eeg_ref or avg_ref everywhere?
if you don't plan to use the average ref later then indeed it's important to
compute EOG SSPs without average ref. But otherwise I don't think it
matters much.
I had been explicitly removing the average projection as you suggested, but it perplexingly still seemed to be getting applied. After digging into the code, I think I found out why though. The compute_proj_eog function seems to always add and apply an average reference projection when making the eye blink epochs because the epochs add_eeg_ref parameter is left at its default of True and is not externally exposed (line 187 of ssp.py). Consequently, the compute_proj_eog avg_ref parameter does not actually have any control over whether the average reference gets applied. Is this correct? If so, then perhaps this is a bug that needs to be fixed? Especially if one wants to utilized EOG/ECG SSPs, but doesn't want to average re-reference as Alex pointed out, but also if it is better to first compute the projections and then re-reference. I personally was interested in which order would be best as I am both re-referencing and applying EOG projections.
in the MNE suite, EEG data *always* needs to have a reference set. If no
reference is explicitly set, MNE will keep trying to add one (an average
reference). This is currently not documented in the manual (I've created
a ticket for this https://github.com/mne-tools/mne-python/issues/3538).
In your case, the default average reference is not desired, so you need
to explicitly set a reference using the mne.io.set_eeg_reference()
function. Doing this will cause MNE to stop adding the average reference
all over the place. To explicitly tell MNE that the data has already
been referenced, you would call mne.io.set_eeg_reference(raw, []). This
will also remove any existing (inactive) average ref projections.