<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Dear Stephen,</p>
    <p>you could also apply the nanconv() function of B.Kraus, available
      on  Matlab's fileexchange.<br>
    </p>
    <p>(<a class="moz-txt-link-freetext" href="http://www.mathworks.com/matlabcentral/fileexchange/41961-nanconv">http://www.mathworks.com/matlabcentral/fileexchange/41961-nanconv</a>)</p>
    <p>I'm doing my own wavelet processing for the reason that part of
      my epochs are filled with nan's due to experimental design.</p>
    <p>But fieldtrip website remains a huge source of infos, tips and
      solutions where to look for :)</p>
    <p>all the best,</p>
    <p>Tzvetomir<br>
    </p>
    <div class="moz-cite-prefix">On 2016-05-25 10:08 PM, Stephen
      Whitmarsh wrote:<br>
    </div>
    <blockquote
cite="mid:CAFrxm=zHNs4APevdkep8dAphcO8UDAvKyPBKi6dVKBtifhhfmg@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <div>As a follow-up: I guess the best solution in the case
            would then be to make my TFR, and replace those values with
            nans based on the sample number from the time-series
            artifact detection. <br>
            <br>
          </div>
          Cheers,<br>
        </div>
        Stephen<br>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On 25 May 2016 at 15:58, Stephen
          Whitmarsh <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:stephen.whitmarsh@gmail.com" target="_blank">stephen.whitmarsh@gmail.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div dir="ltr">
              <div>
                <div>
                  <div>Hi Jim!<br>
                    <br>
                  </div>
                  Thanks. Ofcourse, that's the problem. However, method
                  = 'wavelet', and method = 'tfr' give the same problem.
                  I'm afraid I'll end up writing my own code, cutting up
                  data and using an FFT :-/<br>
                  <br>
                </div>
                Thank again,<br>
                <br>
              </div>
              Stephen<br>
            </div>
            <div class="HOEnZb">
              <div class="h5">
                <div class="gmail_extra"><br>
                  <div class="gmail_quote">On 25 May 2016 at 15:34,
                    Herring, J.D. (Jim) <span dir="ltr"><<a
                        moz-do-not-send="true"
                        href="mailto:j.herring@donders.ru.nl"
                        target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:j.herring@donders.ru.nl">j.herring@donders.ru.nl</a></a>></span>
                    wrote:<br>
                    <blockquote class="gmail_quote" style="margin:0 0 0
                      .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi
                      Stephen,<br>
                      <br>
                      As far as I know this is expected as mtmconvol is
                      actually multiplying the fft of the entire trial
                      with the fft of your tapered windows. Perhaps it
                      will work of you use one of the methods that
                      actually uses convolution in the time domain
                      rather than multiplication in the frequency
                      domain.<br>
                      <br>
                      Best,<br>
                      <br>
                      Jim<br>
                      <div>
                        <div><br>
                          <br>
                          <br>
                          > On 25 May 2016, at 15:29, Stephen
                          Whitmarsh <<a moz-do-not-send="true"
                            href="mailto:stephen.whitmarsh@gmail.com"
                            target="_blank">stephen.whitmarsh@gmail.com</a>>
                          wrote:<br>
                          ><br>
                          > Hi FieldTrippers,<br>
                          ><br>
                          > I hope someone can help me with the
                          following.<br>
                          ><br>
                          > My problem is that I like to maintain my
                          original rpt/chan/time/freq size after
                          artefact rejection based on the time series
                          data, i.e. to have the same dimensions of the
                          TFR as if I did not reject data. This is for
                          reasons of bookkeeping between different types
                          of channels that are processed differently
                          throughout my analysis.<br>
                          ><br>
                          > What works well is to detect artifacts in
                          the data and replace those intervals with nans
                          using ft_rejectartifact, with cfg.reject =
                          'nan'. So far this is perfect for the approach
                          I had in mind.<br>
                          ><br>
                          > However, ft_freqanalysis (method =
                          'mtmconvol') outputs whole trials as nans
                          whenever a (small) period has nans. What I
                          would need - and in fact expect - is that only
                          those time/frequency windows that have (one or
                          more) nan values will output nan, while the
                          rest should merrily go round giving power
                          values. After all, the data is there.<br>
                          ><br>
                          > It is unclear to me whether this is
                          expected behaviour or not. I might be making a
                          mistake but some simple tests replicated this
                          behaviour.<br>
                          ><br>
                          > Is there a solution that still allows me
                          to end up with a rpt/chan/time/freq
                          representation of the same size as when i
                          would not have rejected artifacts?<br>
                          ><br>
                          > The only other FieldTrip-like option I
                          can think of is to use ft_rejectartifact with
                          method = 'partial', do the freqanalysis on
                          trial parts, and somehow glue the separate
                          trial parts together again afterwards. But I
                          really don't want to go in that direction.<br>
                          ><br>
                          > In the end I'm afraid I don't understand
                          the core of ft_specest_mtmconvol enough to see
                          where I could hack it. I hope some of you
                          might be able to help.<br>
                          ><br>
                          > Best wishes,<br>
                          > Stephen<br>
                          ><br>
                          ><br>
                        </div>
                      </div>
                      >
                      _______________________________________________<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"
                        rel="noreferrer" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><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"
                        rel="noreferrer" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
                    </blockquote>
                  </div>
                  <br>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </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">-- 
__________________________________________________

Tzvetomir Tzvetanov, PhD
(赐为)

Associate Professor
Vision Research Laboratory, School of Life Sciences,
CAS Key Laboratory of Brain Function and Disease,
University of Science & Technology of China
Hefei, Anhui 230027, P.R.China
<a class="moz-txt-link-freetext" href="http://vision.ustc.edu.cn/">http://vision.ustc.edu.cn/</a>
Email: <a class="moz-txt-link-abbreviated" href="mailto:tzvetan@ustc.edu.cn">tzvetan@ustc.edu.cn</a>


</pre>
  </body>
</html>