line noise & interpolation Laplace

109 views
Skip to first unread message

Raquel London

unread,
Jul 13, 2016, 2:42:27 PM7/13/16
to AnalyzingNeuralTimeSeriesData
Hi Mike,

What if I wanted to analyze from 2-80 Hz. I would then have to get rid of line noise, but wouldn't I then attenuate signal all around 50 Hz and end up with a ''hole'' in my data? Or could I just leave the noise in and assume it would be the same across conditions?
Also, i was wondering what happens with the Laplacian if there is a bad electrode and it was interpolated; is it still valid to do a Laplacian? And wouldn't it then attenuate signal from this electrode and its neighbors because they would be similar?

Thank you for your time. Please just ignore me if I ask too many questions...

Raquel

Mike X Cohen

unread,
Jul 13, 2016, 3:10:13 PM7/13/16
to analyzingneura...@googlegroups.com
See below...

On Wed, Jul 13, 2016 at 8:42 PM, Raquel London <raquel...@gmail.com> wrote:
Hi Mike,

What if I wanted to analyze from 2-80 Hz. I would then have to get rid of line noise, but wouldn't I then attenuate signal all around 50 Hz and end up with a ''hole'' in my data?


Yes, a notch filter would give a dip in the power spectrum. If you want to remove the line noise while preserving the 50-Hz brain activity, you could try to design a spatial filter for 50 Hz, and then subtract that filter. Google "joint decorrelation" to find a paper that shows how to do that. de Cheveigné, the author of that paper, has a Matlab toolbox that implements some of those filtering options.

 
Or could I just leave the noise in and assume it would be the same across conditions?


This works if the noise isn't too bad, if it's very stationary, and if you do baseline normalization.

 
Also, i was wondering what happens with the Laplacian if there is a bad electrode and it was interpolated; is it still valid to do a Laplacian? And wouldn't it then attenuate signal from this electrode and its neighbors because they would be similar?


The Laplacian is a spatial bandpass filter. One single noisy electrode has a high spatial frequency, and will be attenuated by the Laplacian if you have enough electrodes. For example, the Laplacian is effective at isolating EMG noise near the face and neck. You can try it on some sample data and see how it looks. More generally, what to do about noisy electrodes also depends on how important that electrode is. If you are looking at occipital activity and FP1 is noisy, I probably wouldn't even bother with it. 

 
Thank you for your time. Please just ignore me if I ask too many questions...


Once you get to 10 per day, I'll consider it ;)


 
Raquel

--
You received this message because you are subscribed to the Google Groups "AnalyzingNeuralTimeSeriesData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to analyzingneuraltimes...@googlegroups.com.
Visit this group at https://groups.google.com/group/analyzingneuraltimeseriesdata.
For more options, visit https://groups.google.com/d/optout.



--
Mike X Cohen, PhD
mikexcohen.com

Raquel London

unread,
Aug 11, 2016, 10:36:05 AM8/11/16
to AnalyzingNeuralTimeSeriesData
Hi Mike,

I hope you are well. I'm doing manual artifact rejection and I'm coming across a specific type of noise I hadn't really thought a lot about before. I'm referring to these short bursts of high frequency activity that are the same over all electrodes and produce those vertical bands (there are three epochs displayed):



Is this line noise or something else? Should I get rid of the first and last epoch or should I ignore this altogether during artifact rejection and deal with it in another way? 

The reason I'm posting in this thread is that I tried to see what would happen if I applied a Laplacian transform to the data and a few more questions came up:
Is it OK to apply the Laplacian at any point in the preprocessing protocol or is there a reason to apply it at the very last step?
When I looked at the transformed data in the scroll plot, it looked a lot noisier over all frequencies, as if every feature had been exaggerated. I had to increase the scaling by a factor of 10 to be able to properly visualise it and it still looked messy compared to the pre-Laplacian data. Did I do something wrong? Below is the code I used:

Thanks!
Raquel

%COMPUTE LAPLACIAN
%compute inter-electrode distances
interelectrodedist=zeros(EEG.nbchan);
for chani=1:EEG.nbchan
    for chanj=chani+1:EEG.nbchan
        interelectrodedist(chani,chanj) = sqrt( (EEG.chanlocs(chani).X-EEG.chanlocs(chanj).X)^2 + (EEG.chanlocs(chani).Y-EEG.chanlocs(chanj).Y)^2 + (EEG.chanlocs(chani).Z-EEG.chanlocs(chanj).Z)^2);
    end
end

valid_gridpoints = find(interelectrodedist);

% extract XYZ coordinates from EEG structure
X = [EEG.chanlocs.X];
Y = [EEG.chanlocs.Y];
Z = [EEG.chanlocs.Z];

% create G and H matrices
[ldata,G,H] = laplacian_perrinX(EEG.data(:,:,:),X,Y,Z,10,1e-6);

EEG.data = ldata;

eeglab redraw
See below...

Raquel
To unsubscribe from this group and stop receiving emails from it, send an email to analyzingneuraltimeseriesdata+unsub...@googlegroups.com.

Mike X Cohen

unread,
Aug 11, 2016, 11:16:58 AM8/11/16
to analyzingneura...@googlegroups.com
Hi Raquel. I've seen those kinds of artifacts before. To be honest, I have no idea what causes them. I've always suspected movement, like perhaps a hiccup or something. You could try making topographical plots of that artifact. Anyway, I reject trials that look like trial 80, particularly when the artifact is right around time=0. 

Even aside from the EEG artifact, there is reason to remove that trial: Something caused an artifact at time=0, which means the subject did something exactly at stim onset to cause an artifact, which means the subject might not have been paying attention to the stimulus. 

That said, to the extent that the artifact is spatially restricted, the Laplacian should be able to minimize it. You want to apply the Laplacian as the final processing step so it is easy to re-analyze the voltage data. In fact, I usually apply the Laplacian at the beginning of the analysis script, not during preprocessing. It takes only a few seconds to compute, so no big deal. 

Also keep in mind that the Laplacian has a different scale -- uV/mm^2, so the raw numbers will indeed be different. Don't be concerned. Finally, you can also simplify the line that calls the Laplacian: 

ldata = laplacian_perrinX(EEG.data,[EEG.chanlocs.X],[EEG.chanlocs.Y],[EEG.chanlocs.Z]);

Mike




Raquel London

unread,
Aug 11, 2016, 11:29:40 AM8/11/16
to AnalyzingNeuralTimeSeriesData
Hi Mike,

Thanks for your advice! In this case, the subject that was producing all these artifacts did also have quite bad behavioral performance, so it would make sense that it was movement. 

Raquel

Raquel London

unread,
Oct 1, 2016, 1:03:19 PM10/1/16
to AnalyzingNeuralTimeSeriesData
Hi Mike,

I hope you are well! I have two questions about the Laplacian. 

1.- I tried, but I couldn't find a definitive answer online that I was able to fully understand. In your book, you say that the surface Laplacian is reference independent. Does this mean that it doesn't matter how the data you put into it is referenced; it will always give the same output? Also, I've heard of, and seen mentions of "Laplacian reference", is the Laplacian then just another form of referencing the data? That would all just be so convenient, I hope its true :-)

2.- When looking at the difference between Laplacian transformed- and non-transformed data, I see some stuff that makes me happy, and other stuff that makes me unhappy and I wonder if I should worry about or take into account somehow. So for example in this dataset, left is the non-transformed and right the transformed data:


I can see how artifacts that are spread over various channels are attenuated; for example at the beginning of epoch 1 and at -1000 of epoch 2. And in general, most electrodes look more "unique". 
But there is also a big increase in the relative amplitude of muscle noise on electrodes F 3,5,7,4,6,8 for example. I can see why this would happen, but it seems worrying, or don't you agree?

Thanks,
Raquel

Mike X Cohen

unread,
Oct 2, 2016, 10:07:25 AM10/2/16
to analyzingneura...@googlegroups.com
Hi Raquel. See below.


On Sun, Oct 2, 2016 at 2:03 AM, Raquel London <raquel...@gmail.com> wrote:
Hi Mike,

I hope you are well! I have two questions about the Laplacian. 

1.- I tried, but I couldn't find a definitive answer online that I was able to fully understand. In your book, you say that the surface Laplacian is reference independent. Does this mean that it doesn't matter how the data you put into it is referenced; it will always give the same output? Also, I've heard of, and seen mentions of "Laplacian reference", is the Laplacian then just another form of referencing the data? That would all just be so convenient, I hope its true :-)


Yes, the Laplacian will be the same regardless of the inputted reference. In general, voltage data must always be referenced; with the Laplacian, each electrode has its own reference, which is a weighted combinations of all other electrodes.


 
2.- When looking at the difference between Laplacian transformed- and non-transformed data, I see some stuff that makes me happy, and other stuff that makes me unhappy and I wonder if I should worry about or take into account somehow. So for example in this dataset, left is the non-transformed and right the transformed data:



The Laplacian is just a spatial filter; it's not guaranteed to make everything better. Put another way: all choices have unintended consequences. You'll often see that some processing step or analysis is good for some things and suboptimal for other things. Designing experiments is often the same. The question is whether the pros outweigh the cons. In my experience (and that of others), the pros of the Laplacian usually outweigh the cons.


 

I can see how artifacts that are spread over various channels are attenuated; for example at the beginning of epoch 1 and at -1000 of epoch 2. And in general, most electrodes look more "unique". 
But there is also a big increase in the relative amplitude of muscle noise on electrodes F 3,5,7,4,6,8 for example. I can see why this would happen, but it seems worrying, or don't you agree?


I'm not sure if it's something to worry about. The EMG noise might seem relatively stronger on some electrodes, but that's because it's been spatially restricted to those electrodes rather than spreading to other electrodes. 

Raquel London

unread,
Oct 3, 2016, 7:21:11 AM10/3/16
to AnalyzingNeuralTimeSeriesData
Hi Mike, 
Perfect, that makes everything much clearer.
thank you!
Raquel
Reply all
Reply to author
Forward
0 new messages