Deep Brain Stimulus (DBS) artifact edge ringing

Hi everyone!

First, sorry that I write a question which is more related to signal processing and not so much related to the software. But I really would need a second opinion from more experienced researchers.

I have a problem with stimulus artifact edge. I have measured EEG during DBS on and off. The amplifier is not saturating and I'm using 20kHz sampling frequency, so I can see stimulus artifact (140Hz, 90 us pulse) in detailed way. Stim off marker is in the middle of the last stimulus pulse.

Image1:

I have found one ICA component that reduces the stimulus artifact nicely. When I remove this component the result is following.

Image2:

Next when scaled to level of EEG and when we show longer time window and filter 0.5Hz-100Hz without removal of ICA the situation is following:

Image 3:

So there is still artifact in the beginning and the end of the stimulus train. When this same artifact reducing ICA component is removed again in figure 4, the edge effect seems to disappear.

Image 4:

Everything seems to be ok. However, when I import data into database from -500ms to 5000ms relative to stim off, and when I average the epochs, I can see, that at least channel FT9 (marked in red in image 5) is behaving badly. It has kind of e^-t shape, so the shape is more like exponential than linear.

Image 5:

If I do the linear detrend to channel FT9, in the range of 0.1s to 1.5s, the result can be seen in image 6.

Image 6:

This might be ok for ERP analysis in the time range of 40ms-300ms, but if I do some additional analysis in the stimulus off period from 0 to 5s, I think I cannot use the data from FT9 electrode. If I look the channels is column mode, I also see that there is still small sinc oscillation around last stimulus artifact spike, but it seems to fade away during first 40ms duration.

For comparison, if I start the data import after the stimulus I get following result

Image 7:

So in Image 7 the channels are behaving nicely, but the filter transient marker is extending over the first component of the ERP response. I have tried to find another ICA component which would reduce the stimulus artifact, but I haven't found one. SSP is not working either. I have tried also Gaussian filter without success.

So based on the images above, I would have few questions:

  1. Should I do linear detrend or do I have to reject the channel FT9 (I really would not like to do that)
  2. Would it be better to use epochs as in Image 7 even if the filtering transient is possible.
  3. Is it possible to do non-linear detrend to channel FT9 and should I try it?
  4. Is there some way that I could see the effect of removal of single ICA component in averaged signal without every time epoching data to database?
  5. Is there some other method I could use to handle this edge effect?

Thank you for your answers in advance!

I'm sorry, we are not experts in this field. We do not offer specialized tools to remove this kind of artifacts yet (but contributors would be welcome!)
I don't know to what extent it is possible to correct for this DBS artifact, or if you should just accept that you can't remove it and ignore the data contaminated by it. It looks short, so it might not lose too much data. By trying to correct for the artifact with frequency filters, ICA, or other non-linear methods is that you might damage seriously the valid EEG data that you have immediately after the artifact.

Example of issues related with filtering:
The filter you used (0.5-100Hz) is 3.6 second long, with a high energy during at least 60ms. This means that if you apply this filter to a sharp transient (such as your DBS artifact), it will strongly propagate this artifact at least 60ms before and after the pulse, and more discretely up to 3.6s on each side. This will make the EEG recordings difficult to interpret at least 60ms after the last DBS pulse. If the artifact itself is shorter than 60ms, you might prefer not applying any filter.

Should I do linear detrend or do I have to reject the channel FT9

This seems really random to me...

Would it be better to use epochs as in Image 7 even if the filtering transient is possible.

In all the cases, you should not filter your data after epoching but filter the continuous files and then epoch, so the time window you consider for your epochs has no impact no the duration of the artifact.

Is it possible to do non-linear detrend to channel FT9 and should I try it?

This seems even more random than a linear detrend. You would alter your EEG data in a way you can't control. You don't know what you expect to see in the EEG after the pulse, so you don't know what to remove from your signal.

Is there some way that I could see the effect of removal of single ICA component in averaged signal without every time epoching data to database?

Not that I know of.

Is there some other method I could use to handle this edge effect?

No filter and no ICA, just marking as bad the artifact?

--

But maybe I'm wrong regarding everything that I wrote here, I am not familiar with this topic.
What I'd recommend is to contact other researchers working with EEG+DBS or EEG+TMS and ask them how they denoise their recordings if they claim they can interpret correctly the EEG during or immediately after the stimulation (during the observed artifact). You can find a list of articles published using Brainstorm on our publications page (https://neuroimage.usc.edu/brainstorm/Pub), and you should also try asking the EEGLAB, FieldTrip and MNE-Python communities.

Thank you Francois!

I'll contact other researchers and I'll check those other communities as you suggested.
It was good that you reminded me, that also TMS+EEG researchers might be facing this kind of issues.

Please post here any interesting feedback you might get!
Thanks