Remove segments containing EOG artifacts using a localised Savitzky-Golay filter

Hello,

In order to remove EOG artifacts from my signal by removing as little signal as possible, I first used
mne.preprocessing.find_eog_events’ to find the timestamp of the signal part containing EOG and put aside the raw signal with EOG artifacts annotated. I then used a Savitzky-Golay filter (‘scipy.signal.savgol_filter’) in an aggressive way and obtained a smoothed signal but with a large part of the low frequencies of the signal being attenuated. Finally instead of taking the filtered signal, I kept the raw annotated signal and replaced every segment of annotated EOG by the corresponding segment of the filtered signal. This way only the segment detected as EOG have been filtered and the signal was much better preserved.

But I am not 100% sure about the legitimacy of this method so I wanted to know your opinion, does this method of applying locally a filter sound right to you? I have not been really able to find similar methods in other people, can this refer to a certain method that you know?

Thanks in advance

(pull up in case someone has a clue :crossed_fingers:)

patching in filtered sections risks causing discontinuities / jumps in the data, which can introduce broadband artifacts. If you’re concerned about filtering, you could consider using regression to remove the EOG artifacts instead.

1 Like

Thanks for the tips! It seems to be indeed the same kind of technique. I will find out more about the regression methods and compare them (one my concern with my experimental method was that I had trouble quantifying its effectiveness because the eventual discontinuities were not showing on a frequential or temporal representation)