Mean subtraction before covariance computation

600 views
Skip to first unread message

ap...@nu.edu.kz

unread,
Nov 22, 2016, 1:25:39 PM11/22/16
to AnalyzingNeuralTimeSeriesData
Hello,

I wanted to ask about the subtraction of the average from the LFP data. I think it is common to rectify EEG data but not LFP (what I have seen from the papers). In your lectures about the General Eigendecomposition you said it is important to subtract the mean before computation of the covariance matrix, so my question is: Should I compute the mean from the rectified signal or original one?

I am asking because there are two different ways to do it:

1) I can just subtract the mean from the original data. In this case it will be close to 0, because the signal is not rectified. Not big difference from the original signal.
LFP = LFP - mean(LFP)

2) I can take absolute of the signal and then compute the mean then subtract the mean from the rectified signal. After this, revert negative values back.
mask = LFP<0
mean = abs(LFP).mean()
LFP_norm = abs(LFP) - mean
LFP_norm[mask] =  LFP_norm[mask] * (-1)

I attached plots generated from two different approaches.    

The same applies to the baseline subtraction, which way is the proper way of doing this?

Thanks,
1.png
2.png

Mike X Cohen

unread,
Nov 22, 2016, 1:38:12 PM11/22/16
to analyzingneura...@googlegroups.com
Hello. I don't think it's common in EEG to rectify the signal. Mostly that's done in EMG, where the total energy is the primary dependent variable. I'm not sure what your goal is, but I would not normally recommend rectifying an LFP signal. For one thing, it changes the frequency characteristics. To see why that's the case, you can plot the power spectrum of a simulated sine wave at 10 Hz, and then plot the power spectrum of the same sine wave but rectified.

As for subtracting the mean before computing the covariance matrix, it depends on what you want to do with that matrix. For an eigendecomposition (PCA or GED), you definitely should subtract the mean, otherwise the first component will reflect the mean offset, not the variance in the data.

As for how to subtract the mean, your first suggestion was correct -- subtract the mean from the signal as the final step before computing its covariance.

Mike



--
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 analyzingneuraltimeseriesdata+unsub...@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

ap...@nu.edu.kz

unread,
Nov 23, 2016, 10:31:15 AM11/23/16
to AnalyzingNeuralTimeSeriesData
Thanks for a quick reply, I was confused because mean computed from the original signal is close to 0, so it does not really change the signal. 

Mike X Cohen

unread,
Nov 23, 2016, 10:35:00 AM11/23/16
to analyzingneura...@googlegroups.com
If the mean was close to zero, then the signal was already almost demeaned. This is probably due to a high-pass filter. 

Mike


Reply all
Reply to author
Forward
0 new messages