<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Dear Ingrid and others,</div><div><br></div><div>I forgot to mention, the default has changed one year ago, according to the following thread on the list:</div><div><br></div><a href="http://mailman.science.ru.nl/pipermail/fieldtrip/2012-January/004666.html">http://mailman.science.ru.nl/pipermail/fieldtrip/2012-January/004666.html</a><div><br></div><div>Apologies for not having updated the FAQ. Ingrid, would you mind giving this a shot?</div><div><br></div><div>Best,</div><div><br></div><div>Jan-Mathijs</div><div><br></div><div><br></div><div><br><div><div>On Jan 7, 2013, at 8:31 PM, Ingrid Nieuwenhuis wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
  
    <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type">
  
  <div text="#000000" bgcolor="#FFFFFF">
    Hi Roemer,<br>
    <br>
    Thanks for pointing to these questions. I'm a little bit confused
    about the default behavior with cfg.polyremoval as described there.
    So it seems the default of polyremoval for ft_freqanalysis is 1,
    meaning detrending always happens unless you specify otherwise,
    correct? So that means you don't have to call preprocessing with
    cfg.detrend = 'yes', correct? But you do have to specify cfg.demean
    = 'yes' in preprocessing? Or does removing the linear trend (which
    is the default) in ft_freqanalysis automatically also demean the
    data? From the text under the figure in
    <a class="moz-txt-link-freetext" href="http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange">http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange</a> it
    almost looks that way. Because it talks about cfg.polyremoval in the
    context of demeaning, not detrending. I don't find that text very
    clear by the way. Also, the title above the figure says "TFR before
    (left) and after (right) subtracting the DC component in the time
    domain", while when I look at the code it seems it should be "TFR of
    channel with large DC component (left) and channel without DC
    component (right) after ft_freqanalysis without demeaning". I'd be
    happy to update the FAQ, but first wanted to check whether I
    understand correctly :)<br>
    <br>
    Cheers,<br>
    Ingrid<br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 1/7/2013 4:28 AM, Roemer van der
      Meij wrote:<br>
    </div>
    <blockquote cite="mid:CA+WpQ37gyb0Twxk3m6-m+9K1qbPDXudSXxKcuYnRtimQ9-Uqjg@mail.gmail.com" type="cite">
      <div dir="ltr">Hi Vitoria,
        <div><br>
        </div>
        <div style="">I have only one thing to add to Ingrid's clear
          explanation. For frequency analysis, it's mostly a matter of
          noise. If you do not demean, the 0Hz been can bleed into all
          other frequency bins in a funny but patterned way. For
          detrending, the same story applies. When not detrending, the
          power of the center frequency of the linear trend (this
          frequency is very low), can bleed into other bins. </div>
        <div style=""><br>
        </div>
        <div style="">The FAQs have two great example on this:</div>
        <div style=""><a moz-do-not-send="true" href="http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange">http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange</a><br>
        </div>
        <div style=""><a moz-do-not-send="true" href="http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange_part_ii">http://fieldtrip.fcdonders.nl/faq/why_does_my_tfr_look_strange_part_ii</a><br>
        </div>
        <div style=""><br>
        </div>
        <div style="">Both are specific for when using 'mtmconvol' as
          frequency method (why this is so is explained shortly in the
          first FAQ), although in principle the issues could also occur
          using the other methods.<br>
        </div>
        <div style=""><br>
        </div>
        <div style="">Hope it helps!</div>
        <div style=""><br>
        </div>
        <div style="">All the best,</div>
        <div style="">Roemer</div>
        <div style=""><br>
        </div>
        <div style=""><br>
        </div>
        <div class="gmail_extra"><br>
          <div class="gmail_quote">
            On Sun, Jan 6, 2013 at 3:24 AM, Ingrid Nieuwenhuis <span dir="ltr"><<a moz-do-not-send="true" href="mailto:inieuwenhuis@berkeley.edu" target="_blank">inieuwenhuis@berkeley.edu</a>></span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi
              Vitoria,<br>
              <br>
              The problem with these things is, it depends on what your
              interested in (hypothesis) and which methods you're using
              to analyze the data (ERP or frequanalysis, with our
              without ICA). All analysis steps have different pro and
              cons, so depending on your hypotheses and effects, what's
              good in one setup can be bad in the next. So you have to
              think of what the measures do, and how that effects your
              data.<br>
              <br>
              But now for some answers :) I'm just using a lot of
              experience and some common sense, maybe people can add in
              some refs and math if they know :)<br>
              Demeaning just subtracts the mean of the specified time
              window (or indeed whole trial) from all samples<br>
              detrending removes linear trend (you can also remove
              higher order trends, just for completeness)<br>
              <br>
              For ERPs you generally do want to demean using the
              baseline window, so the effect cancels out pre-stim. You
              don't want to detrend here, since often the ERP can have
              late components, and the signal might not be back to
              baseline yet. If you detrend in such a case, you will
              decrease the value samples late in the trials and increase
              the values during baseline. You will tilt the data (end
              down thus start up). But if you expect a linear trend due
              to equipment drift over longer time, that can muddle the
              ERP effect, then you might want to detrend. Also when the
              signal is noisy (high amplitude noise) at the end (due to
              speach artifacts), detrending might be dangerous.<br>
              <br>
              For frequency analysis, demeaning has (as far as I know)
              no effect, since subtracting a constant does not change
              the frequency info in the signal. I know people do tend to
              detrend before freq analysis (so I also tend to do that),
              but I have to admit, I don't know why really. Maybe to get
              rid of the drift, so it does not end up in the low
              frequencies. But again, the effect of detrending (which
              freqs it affects) depends how long your time window is,
              and which frequencies your interested in. If you are
              interested in really low frequencies, detrending might
              change your effects.<br>
              <br>
              Hope this helps somewhat,<br>
              Ingrid
              <div class="">
                <div class="h5"><br>
                  <br>
                  <br>
                  On 1/5/2013 2:21 AM, Vitória Magalhães Piai wrote:<br>
                  <blockquote class="gmail_quote" style="margin:0px 0px
                    0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Dear
                    ftrippers,<br>
                    <br>
                    I'm having a discussion with a colleague on
                    something that is still a bit unclear to us. Since I
                    trust the knowledge going around here a lot, I
                    thought it would be my best chance to get a good
                    answer: When should we demean/detrend?<br>
                    <br>
                    As relevant background, our EEG datasets involve
                    speech production on every trial.<br>
                    We read in the data, use ft_databrowser to mark the
                    artefacts and then do complete artefact rejection
                    with ft_rejectartifact. The trials often include
                    speech (onset).<br>
                    I see in the tutorial that the cfg for preprocessing
                    is pretty simple, and ft_preprocessing default has
                    no detrend/demean.<br>
                    But in the FT example 'Reading and pre-processing
                    EEG data', the cfg is<br>
                    <br>
                    cfg.demean           = 'yes';<br>
                    cfg.baselinewindow  = [-0.2 0];<br>
                    <br>
                    <br>
                    In my data, I used cfg.demean = 'yes'; with no cfg
                    for the baseline window because I don't want to
                    correct the signal with a specific interval (and I
                    assume this will take the whole segment then).<br>
                    Our concern is that, given that people speak during
                    part of the trial (always towards the end), using
                    demean here is not a good idea (the signal changes
                    induced by moving the jaws, etc., are included in
                    the calculation). Is this necessarily the case or
                    can it be fixed with subsequent computations (see
                    below)? Do I need to go through artefact rejection
                    again? My guess would be that the damage caused by
                    having demean here doesn't change that much where
                    the eyeblinks are and I always take quite broad
                    windows to mark the artefacts, so at least for the
                    AR I should be safe, but I'd like to check that with
                    you guys.<br>
                    <br>
                    Then, when calculating ERPs, I had both demean and
                    detrend before timelocking.<br>
                    But for the TFRs, I didn't do any of these (dunno
                    why). I'm using the ft_freqanalysis after the 2011
                    change (removing the first order linear trend from
                    the time domain data).<br>
                    Do I need to redo my TFRs or is it enough if I do
                    sanity checks and everything is in place (like
                    visual alpha and gamma, etc.)?<br>
                    <br>
                    And my last question, for once and for all, so that
                    I get it right next time from the start (assuming
                    that I'll always have EEG speech production data
                    with ERPs and TFRs analysed). Is this the best way
                    to do it?<br>
                    - preprocess with default (so NO detrend and NO
                    demean)<br>
                    - then demean and detrend for ft_timelockanalysis
                    and ft_freqanalysis<br>
                    <br>
                    Thanx a lot, and (keeping to the Dutch tradition)
                    all the best for 2013!<br>
                    Vitoria<br>
                    <br>
                    <br>
                    <br>
                    _______________________________________________<br>
                    fieldtrip mailing list<br>
                    <a moz-do-not-send="true" href="mailto:fieldtrip@donders.ru.nl" target="_blank">fieldtrip@donders.ru.nl</a><br>
                    <a moz-do-not-send="true" href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
                  </blockquote>
                  <br>
                </div>
              </div>
              <span class=""><font color="#888888">
                  -- <br>
                  Ingrid Nieuwenhuis PhD<br>
                  Postdoctoral Fellow<br>
                  Sleep and Neuroimaging Laboratory<br>
                  Department of Psychology<br>
                  University of California, Berkeley<br>
                  California 94720-1650<br>
                  Tolman Hall, room 5305</font></span>
              <div class="">
                <div class="h5"><br>
                  <br>
                  _______________________________________________<br>
                  fieldtrip mailing list<br>
                  <a moz-do-not-send="true" href="mailto:fieldtrip@donders.ru.nl" target="_blank">fieldtrip@donders.ru.nl</a><br>
                  <a moz-do-not-send="true" href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
                </div>
              </div>
            </blockquote>
          </div>
          <br>
        </div>
        <br clear="all">
        <div><br>
        </div>
        -- <br>
        <font size="3"><font color="darkblue"><font face="calibri">Roemer

              van der Meij M.Sc.<br>
              PhD Candidate<br>
              Donders Institute for Brain, Cognition and Behaviour<br>
              Centre for Cognition<br>
              P.O. Box 9104<br>
              6500 HE Nijmegen<br>
              The Netherlands<br>
              Tel: +31(0)24 3655932<br>
              E-mail: <a moz-do-not-send="true" href="mailto:r.vandermeij@donders.ru.nl" target="_blank">r.vandermeij@donders.ru.nl</a></font></font></font>
        <div style="padding:0px;margin-left:0px;margin-top:0px;overflow:hidden;word-wrap:break-word;color:black;font-size:10px;text-align:left;line-height:130%"></div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
fieldtrip mailing list
<a class="moz-txt-link-abbreviated" href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a>
<a class="moz-txt-link-freetext" href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a></pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Ingrid Nieuwenhuis PhD
Postdoctoral Fellow
Sleep and Neuroimaging Laboratory
Department of Psychology
University of California, Berkeley
California 94720-1650
Tolman Hall, room 5305</pre>
  </div>

_______________________________________________<br>fieldtrip mailing list<br>fieldtrip@donders.ru.nl<br>http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</blockquote></div><br><div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Jan-Mathijs Schoffelen, MD PhD </div><div><br></div><div>Donders Institute for Brain, Cognition and Behaviour, <br>Centre for Cognitive Neuroimaging,<br>Radboud University Nijmegen, The Netherlands</div><div><br></div><div>Max Planck Institute for Psycholinguistics,</div><div>Nijmegen, The Netherlands</div><div><br></div><div>J.Schoffelen@donders.ru.nl</div><div>Telephone: +31-24-3614793</div></div></span></div></span></div></span></div></span></div>
</div>
<br></div></body></html>