<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">I would.  Baseline correction removes
      background components from the ERP but it does remove linear
      offset that is part of the post-stimulus time series.  In addition
      to getting ride of DC, detrending also removes certain
      non-stationarities and reduces the severity of edge effects.  I
      use it as a matter of course unless there is a compelling reason
      to omit it from the analysis pipeline.  <br>
      <pre class="moz-signature" cols="72">
</pre>
      On 12/7/14, 5:53 AM, Yun Wen wrote:<br>
    </div>
    <blockquote
cite="mid:5546552AC7F6814B8C9826920C70E5AE3E613B6579@EXCHANGE2.ad.nottingham.ac.uk"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:"Times New Roman \,serif";
        panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML \9884\8BBE\683C\5F0F Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
span.HTMLChar
        {mso-style-name:"HTML \9884\8BBE\683C\5F0F Char";
        mso-style-priority:99;
        mso-style-link:"HTML \9884\8BBE\683C\5F0F";
        font-family:Consolas;
        color:black;}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle20
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal"><span style="color:#1F497D">Hi, Alexander.
            Thank you for your help. Do you suggest that I do baseline
            correction plus detrend, e,g,  cfg.blc = 'yes' &
            cfg.detrend = 'yes' on epoched data? <o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">Best,<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D">Yun<o:p></o:p></span></p>
        <div>
          <p class="MsoNormal"
            style="text-align:justify;text-justify:inter-ideograph"><span
              style="font-size:10.5pt;color:#1F497D"><o:p> </o:p></span></p>
        </div>
        <p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
        <div>
          <div style="border:none;border-top:solid #E1E1E1
            1.0pt;padding:3.0pt 0cm 0cm 0cm">
            <p class="MsoNormal"><b><span style="color:windowtext">From:</span></b><span
                style="color:windowtext">
                <a class="moz-txt-link-abbreviated" href="mailto:fieldtrip-bounces@science.ru.nl">fieldtrip-bounces@science.ru.nl</a>
                [<a class="moz-txt-link-freetext" href="mailto:fieldtrip-bounces@science.ru.nl">mailto:fieldtrip-bounces@science.ru.nl</a>] <b>On Behalf
                  Of </b>Alexander Nakhnikian<br>
                <b>Sent:</b> Saturday, December 06, 2014 1:14 AM<br>
                <b>To:</b> FieldTrip discussion list<br>
                <b>Subject:</b> Re: [FieldTrip] about detrend<o:p></o:p></span></p>
          </div>
        </div>
        <p class="MsoNormal"><o:p> </o:p></p>
        <div>
          <p class="MsoNormal">It looks as though the take home message
            is that in theory high pass filters remove DC but you can't
            be sure how they will interact with empirical data since
            there is no perfect filter in the real world.  If other
            people report substantial artifacts after filtering data
            without removing the DC component I suggest getting rid of
            it.  To answer your original question, assuming you're
            detrending each epoch individually it should remove the DC
            component or at least reduce it substantially.   <br>
            <br>
            I hope that helps.<br>
            <br>
            <br>
            <br>
            On 12/5/14, 6:20 PM, Yun Wen wrote:<span
              style="font-size:12.0pt"><o:p></o:p></span></p>
        </div>
        <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
          <p class="MsoNormal"><span style="color:#1F497D">Hi, Alexander
              & Rodrigo. Thank you very much for your help. I
              collected my data with DC recordings (BioSemi system). I
              have seen some discussion on the DC offset:</span><o:p></o:p></p>
          <p class="MsoNormal"><a moz-do-not-send="true"
              href="http://sccn.ucsd.edu/pipermail/eeglablist/2014/008068.html">http://sccn.ucsd.edu/pipermail/eeglablist/2014/008068.html</a><o:p></o:p></p>
          <p class="MsoNormal"><a moz-do-not-send="true"
              href="http://sccn.ucsd.edu/pipermail/eeglablist/2008/002229.html">http://sccn.ucsd.edu/pipermail/eeglablist/2008/002229.html</a><o:p></o:p></p>
          <p class="MsoNormal"><a moz-do-not-send="true"
              href="http://sccn.ucsd.edu/pipermail/eeglablist/2010/003315.html">http://sccn.ucsd.edu/pipermail/eeglablist/2010/003315.html</a><o:p></o:p></p>
          <p class="MsoNormal"><a moz-do-not-send="true"
href="http://erpinfo.org/erplab/erplab-documentation/manual/Filtering.html">http://erpinfo.org/erplab/erplab-documentation/manual/Filtering.html</a><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:#1F497D">It seems to
              me that I’d better remove DC offset of continuous data
              before high-pass filter. Am I right?</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:#1F497D">Best,</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:#1F497D">Yun</span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></p>
          <div>
            <div style="border:none;border-top:solid #E1E1E1
              1.0pt;padding:3.0pt 0cm 0cm 0cm">
              <p class="MsoNormal"><b><span style="color:windowtext">From:</span></b><span
                  style="color:windowtext"> </span><a
                  moz-do-not-send="true"
                  href="mailto:fieldtrip-bounces@science.ru.nl">fieldtrip-bounces@science.ru.nl</a><span
                  style="color:windowtext"> [</span><a
                  moz-do-not-send="true"
                  href="mailto:fieldtrip-bounces@science.ru.nl">mailto:fieldtrip-bounces@science.ru.nl</a><span
                  style="color:windowtext">] <b>On Behalf Of </b>Alexander
                  Nakhnikian<br>
                  <b>Sent:</b> Friday, December 05, 2014 10:19 PM<br>
                  <b>To:</b> FieldTrip discussion list<br>
                  <b>Subject:</b> Re: [FieldTrip] about detrend</span><o:p></o:p></p>
            </div>
          </div>
          <p class="MsoNormal"> <o:p></o:p></p>
          <div>
            <p class="MsoNormal">Hello Again,<br>
              <br>
              I think there's an error in my response. I think removing
              the linear trend should also set the mean to zero already
              since the best fit line incorporates vertical offset. 
              Sorry about that.  <br>
              <br>
              A<br>
              <br>
              <br>
              <o:p></o:p></p>
            <pre> <o:p></o:p></pre>
            <p class="MsoNormal">On 12/5/14, 4:20 PM, Yun Wen wrote:<o:p></o:p></p>
          </div>
          <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
            <p class="MsoNormal">Hi all, I want to remove DC offset
              before applying the high-pass filter. I  was wondering if
              I can achieve that by putting cfg.detrend = 'yes' before
              cfg.hpfilter = 'yes', something like:<o:p></o:p></p>
            <p class="MsoNormal"> <o:p></o:p></p>
            <p class="MsoNormal">cfg = []; <o:p></o:p></p>
            <p class="MsoNormal">cfg.dataset = filename_raweeg;<o:p></o:p></p>
            <p class="MsoNormal">cfg.detrend = 'yes'; <o:p></o:p></p>
            <p class="MsoNormal">cfg.hpfilter = 'yes';<o:p></o:p></p>
            <p class="MsoNormal">cfg.hpfiltord = 2; % Order of the
              filter = 2.<o:p></o:p></p>
            <p class="MsoNormal">cfg.hpfreq = 0.1; % High-pass cutoff at
              0.1 Hz;<o:p></o:p></p>
            <p class="MsoNormal">[data] = ft_preprocessing (cfg);<o:p></o:p></p>
            <p class="MsoNormal"> <o:p></o:p></p>
            <p class="MsoNormal">Thank you in advance.<o:p></o:p></p>
            <p class="MsoNormal"> <o:p></o:p></p>
            <p class="MsoNormal">Best,<o:p></o:p></p>
            <p class="MsoNormal">Yun<o:p></o:p></p>
            <p class="MsoNormal"> <o:p></o:p></p>
            <pre> <o:p></o:p></pre>
            <pre> <o:p></o:p></pre>
            <pre>This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it.   Please do not use, copy or disclose the information contained in this message or in any attachment.  Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.<o:p></o:p></pre>
            <pre> <o:p></o:p></pre>
            <pre>This message has been checked for viruses but the contents of an attachment may still contain software viruses which could damage your computer system, you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation.<o:p></o:p></pre>
          </blockquote>
          <p class="MsoNormal"><span
              style="font-size:12.0pt;font-family:"Times New Roman
              ,serif",serif"> </span><o:p></o:p></p>
          <pre><o:p> </o:p></pre>
          <pre><o:p> </o:p></pre>
          <pre>This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it.   Please do not use, copy or disclose the information contained in this message or in any attachment.  Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.<o:p></o:p></pre>
          <pre><o:p> </o:p></pre>
          <pre>This message has been checked for viruses but the contents of an attachment may still contain software viruses which could damage your computer system, you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation.<o:p></o:p></pre>
        </blockquote>
        <p class="MsoNormal"><span
            style="font-size:12.0pt;font-family:"Times New
            Roman",serif"><o:p> </o:p></span></p>
      </div>
      <pre>

This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it.   Please do not use, copy or disclose the information contained in this message or in any attachment.  Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.

This message has been checked for viruses but the contents of an attachment may still contain software viruses which could damage your computer system, you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation.
</pre>
    </blockquote>
    <br>
  </body>
</html>