<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hi Yun,<br>
      <br>
      Detrending a data set only removes the regression line.  It does
      not ensure that the process has zero mean, which translates to a
      zero DC component in frequency space.  The most direct way to
      ensure zero DC is simply to remove the trial mean from each
      epoch.  <br>
      <br>
      Best,<br>
      <br>
      Alexander<br>
      <pre class="moz-signature" cols="72">Alexander Nakhnikian, Ph.D.
Post Doctoral Fellow, Clinical Research Training Program
Harvard Medical School
Boston VA Healthcare System, Brockton MA</pre>
      On 12/5/14, 4:20 PM, Yun Wen wrote:<br>
    </div>
    <blockquote
cite="mid:5546552AC7F6814B8C9826920C70E5AE3E613B6546@EXCHANGE2.ad.nottingham.ac.uk"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
        {font-family:\5B8B\4F53;
        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:"\@\5B8B\4F53";
        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;}
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;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@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">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>
      </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>