<div>Hi Andrew, Soren,</div><div><br></div><div>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?</div>
<div><br></div><div>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):</div><div><br></div><div>% remove *real* channel mean</div>
<div> for numChans = 1:size(EEG.data,1);</div><div> EEG.data(numChans, :) = single(double(EEG.data(numChans, :)) - mean(double(EEG.data(numChans, :))));</div>
<div> end</div><div><br></div>And here is the reason as he put it:<div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">"Converting to double is important. If there is significant drift or DC<br>
offset, the "mean" function (which sums across all points) can cause<br>an overflow error, leading to inaccurate results."</span></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br>
</span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br></span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">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.</span></font></div>
<div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br></span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"> <br>
</span></font><div class="gmail_quote">2011/3/24 "Søren K. Andersen" <span dir="ltr"><<a href="mailto:skandersen@ucsd.edu" target="_blank">skandersen@ucsd.edu</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#ffffff">
Hi Andrew and Baris,<br>
<br>
if you only want to remove DC-offset, subtracting the mean of each
epoch is the best:<br>
<br>
EEG.data=EEG.data-repmat(mean(EEG.data,2),[1 EEG.pnts 1]);<br>
<br>
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!<br>
<br>
Best,<br>
Søren<div><div></div><div><br>
<br>
<br>
On 23-Mar-11 5:35 PM, Andrew Hill wrote:
<blockquote type="cite">Hi Baris,
<div><br>
</div>
<div>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.</div>
<div><br>
</div>
<div>e.g.:</div>
<div><br>
</div>
<div><span style="font-family:Arial">EEG.data
= detrend(EEG.data);</span></div>
<div><span style="font-family:Arial"><br>
</span></div>
<div><span style="font-family:Arial">Best,</span></div>
<div><span style="font-family:Arial">Andrew</span></div>
<div><span style="font-family:Arial"><br>
</span></div>
<div>
<div>
<div>On Mar 21, 2011, at 4:50 AM, Baris Demiral wrote:</div>
<br>
<blockquote type="cite">Hi everyone,
<div><br>
</div>
<div>Do you know which function is the "Remove DC offset" in
the Display call for?</div>
<div><br>
</div>
<div>I was not able to track it out.</div>
<div><br>
</div>
<div>Thanks,</div>
<div>Baris<br clear="all">
<br>
-- <br>
SB Demiral, PhD.<br>
Department of Psychology <br>
7 George Square<br>
The University of Edinburgh<br>
Edinburgh, EH8 9JZ<br>
UK<br>
Phone: +44 (0131) 6503063<br>
</div>
_______________________________________________<br>
Eeglablist page: <a href="http://sccn.ucsd.edu/eeglab/eeglabmail.html" target="_blank">http://sccn.ucsd.edu/eeglab/eeglabmail.html</a><br>
To unsubscribe, send an empty email to <a href="mailto:eeglablist-unsubscribe@sccn.ucsd.edu" target="_blank">eeglablist-unsubscribe@sccn.ucsd.edu</a><br>
For digest mode, send an email with the subject "set digest
mime" to <a href="mailto:eeglablist-request@sccn.ucsd.edu" target="_blank">eeglablist-request@sccn.ucsd.edu</a></blockquote>
</div>
<br>
</div>
<pre><fieldset></fieldset>
_______________________________________________
Eeglablist page: <a href="http://sccn.ucsd.edu/eeglab/eeglabmail.html" target="_blank">http://sccn.ucsd.edu/eeglab/eeglabmail.html</a>
To unsubscribe, send an empty email to <a href="mailto:eeglablist-unsubscribe@sccn.ucsd.edu" target="_blank">eeglablist-unsubscribe@sccn.ucsd.edu</a>
For digest mode, send an email with the subject "set digest mime" to <a href="mailto:eeglablist-request@sccn.ucsd.edu" target="_blank">eeglablist-request@sccn.ucsd.edu</a></pre>
</blockquote>
<br>
<br>
</div></div><font color="#888888"><pre cols="72">--
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: <a href="mailto:skandersen@ucsd.edu" target="_blank">skandersen@ucsd.edu</a></pre>
</font></div>
</blockquote></div><br><br clear="all"><br>-- <br>SB Demiral, PhD.<br>Department of Psychology <br>7 George Square<br>The University of Edinburgh<br>Edinburgh, EH8 9JZ<br>UK<br>Phone: +44 (0131) 6503063<br>
</div>