[Eeglablist] remove DC offset

Baris Demiral demiral.007 at googlemail.com
Thu Mar 24 10:37:30 PDT 2011


Hi Andrew, Soren,

Let me clarify what I was trying to ask earlier. When you open the Channel
Data Scroll on the EEGLAB interface, you are given an option in Display
 "Remove DC offset". I tested this option with taking the mean of each
channel as well as detrend function. It looked to me as if (whatever Remove
DC offset is calling as a function), it does better job than the detrend and
mean subtraction do. So, which function is it calling for?

Recently, Bradley Voytek suggested doing the following on the continuous
data at the beginning (even in the biosig import function if you are using
that function):

% remove *real* channel mean
     for numChans = 1:size(EEG.data,1);
     EEG.data(numChans, :) = single(double(EEG.data(numChans, :)) -
mean(double(EEG.data(numChans, :))));
    end

And here is the reason as he put it:
"Converting to double is important. If there is significant drift or DC
offset, the "mean" function (which sums across all points) can cause
an overflow error, leading to inaccurate results."


Previously I was happy with only high-pass filtering (FIR filter) with value
say 0.1 to eliminate/minimize slow drifts on the continuous raw EEG. But
recently,  I started to do the following: Again on the raw EEG, first take
the mean value from each channel out as discussed above, then detrend the
continuous EEG with detrend function, and then high-pass filter (but now I
have some problems with IIR versus FIR filters, IIR does not work on the
continuous EEG data). Then I epoch he data and do other things. I never do
dc correction on the epoched data so far and thanks Soren for clarifying
possible artefacts of doing so.


2011/3/24 "Søren K. Andersen" <skandersen at ucsd.edu>

>  Hi Andrew and Baris,
>
> if you only want to remove DC-offset, subtracting the mean of each epoch is
> the best:
>
> EEG.data=EEG.data-repmat(mean(EEG.data,2),[1 EEG.pnts 1]);
>
> Detrending also removes linear drifts. This is often a good idea for
> time-frequency analysis. However, detrending can cause major distortions
> when analyzing ERPs, especially if epochs are short!
>
> Best,
> Søren
>
>
>
> On 23-Mar-11 5:35 PM, Andrew Hill wrote:
>
> Hi Baris,
>
>  I'm not 100% sure what you are asking, but I use "detrend" to eliminate
> drift that's left in my DC recorded BDF files even after I convert them to
> EDF.
>
>  e.g.:
>
>  EEG.data = detrend(EEG.data);
>
>  Best,
> Andrew
>
>   On Mar 21, 2011, at 4:50 AM, Baris Demiral wrote:
>
> Hi everyone,
>
>  Do you know which function is the "Remove DC offset" in the Display call
> for?
>
>  I was not able to track it out.
>
>  Thanks,
> Baris
>
> --
> SB Demiral, PhD.
> Department of Psychology
> 7 George Square
> The University of Edinburgh
> Edinburgh, EH8 9JZ
> UK
> Phone: +44 (0131) 6503063
>  _______________________________________________
> 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
>
>
>
> --
> Søren K. Andersen, Ph.D.
> Department of Neurosciences
> University of California San Diego
> La Jolla, CA 92093
> Phone:(858) 534-1389
> Fax:  (858) 534-1566
> Email: skandersen at ucsd.edu
>
>


-- 
SB Demiral, PhD.
Department of Psychology
7 George Square
The University of Edinburgh
Edinburgh, EH8 9JZ
UK
Phone: +44 (0131) 6503063
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20110324/c0cba168/attachment.html>


More information about the eeglablist mailing list