[Eeglablist] Filter distortion around boundary events

Makoto Miyakoshi mmiyakoshi at ucsd.edu
Fri Jul 27 16:20:53 PDT 2018


Dear Brian,

> A question for all - to further ameliorate the DC shift, would a linear
detrend over the unepoched data prior to any other step potentially help
with this problem? In a test on one file it seems to help. Then, I could
potentially remove the mean of each channel over the whole recording?

Remember GIGO (garbage in, garbage out). If there is a known source of
artifact in the recording environment, I would do something with it first
before trying any signal processing.

I don't know much about electromagnetic field theory, but I remember a
retired professor (audiophile) once told me that low-frequency shield (I
assume 50 or 60 Hz line noise frequency) is required to be more like a
magnetic shield rather than a electric shield. Standard copper mesh shield
is not very effective to cut low-frequency like line noise. You may want to
try a material with good magnetic permeability to make a hard shell/box. I
just Googled it and found something like this. It seems worth trying.

http://www.adrprovita.com/Magnet-Shield-Plate

When CRT TVs were still popular, there were thin rolls /thick film of some
magnetic material I saw in home centers. This thing can be applied to a
side of a speaker enclosure whose driver units are not magnetically
shielded so that their stray magnetic field does not affect CRT monitor.
Maybe you can still find those products.

Makoto

On Mon, Jul 23, 2018 at 9:42 AM Erickson <ericksonb.eng at gmail.com> wrote:

> Andreas, thanks for your detailed response. Regarding line noise, I think
> there's some kind of power substation box in the room. It is "non-ideal" to
> be sure, but presently that's what we're working with. Your suggestion for
> filtering in two steps with those filter orders is working much better than
> the automatic order option.
>
> A question for all - to further ameliorate the DC shift, would a linear
> detrend over the unepoched data prior to any other step potentially help
> with this problem? In a test on one file it seems to help. Then, I could
> potentially remove the mean of each channel over the whole recording?
>
> Thank you,
> Brian
>
> *Brian Erickson**, Ph.D.*
> *Postdoctoral Researcher, CogNeW Lab*
>
> *Drexel University*
> 3141 Chestnut Street
> Stratton Hall Room 320
> Philadelphia, PA 19104
>
> On Wed, Jul 18, 2018 at 3:04 PM, Makoto Miyakoshi <mmiyakoshi at ucsd.edu>
> wrote:
>
>> Dear Andreas,
>>
>> Just a quick input,
>>
>> > Not sure how Cleanline copes with the TMS artifacts, however.
>>
>> Good point. CleanLine assumes that the noise (in this case, specifically
>> 50/60Hz line noise) to be stationary across time (and purely sinusoidal).
>> Temporally sparse noise like TMS artifact cannot be removed by CleanLine.
>>
>> Makoto
>>
>> On Tue, Jul 17, 2018 at 10:39 PM Andreas Widmann <widmann at uni-leipzig.de>
>> wrote:
>>
>>> Hi Brian,
>>>
>>> this is indeed a prototypical filter edge artifact. Most commonly this
>>> type of artifact is observed with notch filters (but only because notch
>>> filters are most commonly applied for this type of interference) but can
>>> also be observed with low-pass or high-pass filters.
>>>
>>> I'm afraid that you will not get completely rid of this problem. Your
>>> line noise interference is very strong (~1 mV peak-to-peak max on AF3 and
>>> ~500 µV peak-to-peak on average across channels). Filters need some time to
>>> achieve full attenuation. The problem can, however, be significantly
>>> reduced using somewhat different filter settings.
>>>
>>> First, I would suggest to separate high-pass and low-pass filter. You
>>> may then use lower low-pass filter orders considerably reducing the
>>> temporal extent of the artifact. Further, I would suggest to use a lower
>>> low-pass cutoff frequency, e.g. 45 Hz (i.e., passband edge 40 Hz).
>>> EEG = pop_eegfiltnew(EEG, 1,[],6600,0,[],1);
>>> EEG = pop_eegfiltnew(EEG, [],40,660,0,[],1);
>>>
>>> When filtering, the data have to be padded at the edges. We do pad with
>>> a DC constant to reliably avoid DC artifacts. With a harmonic oscillation
>>> in the data, padding with a constant implies amplitude modulation and
>>> amplitude modulation spectrally smears the line noise interference to
>>> adjacent bands at the edges of the signal. Therefore you have to use cutoff
>>> frequencies further away from the line noise interference frequency if the
>>> signal edges are important and cannot be cut away. Intuitively, mirror
>>> padding might might be an apparent solution to this problem. However, this
>>> will introduce other nice edge artifacts due to phase reset and DC shifts.
>>>
>>> Usually, I would recommend to try other ways to remove the line noise
>>> interference, for example Cleanline or DFT filters. Not sure how Cleanline
>>> copes with the TMS artifacts, however. One more comment: The line noise
>>> interference is really strong, even for a recording in an unshielded
>>> environment. Might there possibly be a problem with common mode rejection
>>> in your EEG setup?
>>>
>>> Hope this helps! Best,
>>> Andreas
>>>
>>> > Am 16.07.2018 um 20:48 schrieb Erickson <ericksonb.eng at gmail.com>:
>>> >
>>> > Thanks for your responses.
>>> >
>>> > Andreas, I used the "basic FIR filter" on automatic order calculation
>>> filtering from 1 to 55.
>>> >
>>> > Here is a drive link to a zip file with 30s of example data. These
>>> data were imported using fileIO and the event channel (65) was imported as
>>> events (Nothing else has been done to this example data).
>>> > https://drive.google.com/open?id=1KPlpeBCrCnQJHCJOcMYsnNSJVOjj0bTO
>>> >
>>> > Then I plotted the data and cut out one section around a TMS event,
>>> and another section NOT around a TMS event;
>>> > EEG = eeg_eegrej( EEG, [4615 5372;11482 12002]);
>>> > [ALLEEG EEG CURRENTSET] = pop_newset(ALLEEG, EEG, 1,'setname','with
>>> Rejections','gui','off');
>>> >
>>> > filtered the data using the FIR filter from 1 to 55hz;
>>> > EEG = pop_eegfiltnew(EEG, 1,55,6600,0,[],1);
>>> > [ALLEEG EEG CURRENTSET] = pop_newset(ALLEEG, EEG, 2,'setname','with
>>> Rejections and Filter','gui','off');
>>> >
>>> > then plotting the data, the artifact is visible as a "pinching" around
>>> each boundary, with a faster oscillation riding on top. So basically just
>>> reject any section of data and filter and the artifact appears.
>>> >
>>> > Makoto, to answer the question about the spectra - if I cut out the
>>> TMS pulses and then filter, the PSD looks pretty normal. Prior to filtering
>>> there is so much DC power I can't visually inspect the data very well.
>>> >
>>> > The room is very noisy, but this artifact appears only wherever I make
>>> a boundary and filter so it seems like an edge effect due to filtering -
>>> but I've never encountered this kind of artifact before since EEGLAB knows
>>> not to filter over boundaries. Perhaps I cannot use the automatic filter
>>> order here due to some noise profile in my data?
>>> >
>>> > Thanks to you both for considering the problem!
>>> >
>>> > Brian
>>> >
>>> >
>>> > On Thu, Jul 12, 2018 at 8:54 PM, Makoto Miyakoshi <mmiyakoshi at ucsd.edu>
>>> wrote:
>>> > Dear Erickson
>>> >
>>> > Is this really a distortion introduced by the filter? Rather, isn't it
>>> the case that that portion of the data was poorly filtered i.e., your
>>> original data, before filtering, had that noise constantly? Could you
>>> please check your original data by eyeballing the raw time series and by
>>> checking power spectral density?
>>> >
>>> > Makoto
>>> >
>>> > On Thu, Jul 12, 2018 at 10:33 AM Erickson <ericksonb.eng at gmail.com>
>>> wrote:
>>> > Hello EEGLAB list,
>>> >
>>> > We are experiencing a strange artifact on only some of our EEG data.
>>> For some subjects, when we cut out portions of data (creating boundary
>>> events) and then filter (from 1 to 40 or 50hz) we observe a distortion
>>> around the boundary.
>>> >
>>> > Specifically, we see a rising or falling wave on either side of the
>>> boundary, with a fast oscillation riding on top of it. See here:
>>> https://drive.google.com/open?id=1yt6h_WLgI6jWAApVd52nwVLuiduYgXIH
>>> >
>>> > Although this data is from concurrent TMS-EEG recording, the
>>> distortion has nothing to do with the TMS pulse itself - we get the same
>>> boundary-related distortion when we filter after cutting out a random
>>> section of continuous data (a section with no TMS in it).
>>> >
>>> > I am at a loss - we've tried a few different filters and nothing seems
>>> to solve this issue. Meanwhile, on some subjects there is no
>>> boundary-related filter distortion at all! There is a lot of noise in the
>>> room but I'm not sure how that could create this specific issue.
>>> >
>>> > Any perspectives on this issue are appreciated! Thank you,
>>> >
>>> > Brian
>>> >
>>> > Brian Erickson, Ph.D.
>>> > Postdoctoral Researcher, CogNeW Lab
>>> >
>>> > Drexel University
>>> > 3141 Chestnut Street
>>> <https://maps.google.com/?q=3141+Chestnut+Street&entry=gmail&source=g>
>>> > Stratton Hall Room 320
>>> > Philadelphia, PA 19104
>>> >
>>> > _______________________________________________
>>> > Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
>>> > To unsubscribe, send an empty email to
>>> eeglablist-unsubscribe at sccn.ucsd.edu
>>> > For digest mode, send an email with the subject "set digest mime" to
>>> eeglablist-request at sccn.ucsd.edu
>>> >
>>> >
>>> > --
>>> > Makoto Miyakoshi
>>> > Swartz Center for Computational Neuroscience
>>> > Institute for Neural Computation, University of California San Diego
>>> >
>>> > _______________________________________________
>>> > Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
>>> > To unsubscribe, send an empty email to
>>> eeglablist-unsubscribe at sccn.ucsd.edu
>>> > For digest mode, send an email with the subject "set digest mime" to
>>> eeglablist-request at sccn.ucsd.edu
>>>
>>> _______________________________________________
>>> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
>>> To unsubscribe, send an empty email to
>>> eeglablist-unsubscribe at sccn.ucsd.edu
>>> For digest mode, send an email with the subject "set digest mime" to
>>> eeglablist-request at sccn.ucsd.edu
>>
>>
>>
>> --
>> Makoto Miyakoshi
>> Swartz Center for Computational Neuroscience
>> Institute for Neural Computation, University of California San Diego
>>
>
>

-- 
Makoto Miyakoshi
Swartz Center for Computational Neuroscience
Institute for Neural Computation, University of California San Diego
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20180727/79ef1c2c/attachment.html>


More information about the eeglablist mailing list