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.
I have found one ICA component that reduces the stimulus artifact nicely. When I remove this component the result is following.
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:
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.
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.
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.
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
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:
- Should I do linear detrend or do I have to reject the channel FT9 (I really would not like to do that)
- Would it be better to use epochs as in Image 7 even if the filtering transient is possible.
- Is it possible to do non-linear detrend to channel FT9 and should I try it?
- 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?
- Is there some other method I could use to handle this edge effect?
Thank you for your answers in advance!