<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Dear Gabriel,<br>
      <br>
      <blockquote type="cite"><font size="3"><font size="4">A) As you
            see, this makes an average over the epochs of each channel,
            and not over the samples (which in this case are the 9
            frequencies of the FFT), And I would like to have the op</font><font
            size="3"><font size="4">posite, </font><font size="3"><font
                size="4">t<font size="4">his is, to</font> get the </font><font
                size="3"><font size="4">imaginary part of coherence for
                  each epoch (repeti<font size="4">t</font>ion) on all
                  my channels and not for each frequency, som<font
                    size="4">ething like: chan_chan_rpt or chancbm_rpt</font>,
                </font><font size="3"><font size="4">Is this possible?</font><br>
                </font></font></font></font></font></blockquote>
      <br>
      No. You should think of coherence more as a measure for the
      consistency of the phase relation between channels across trials,
      so coherence is just not defined per trial,neither would it make
      sense to compute coherence for a single trial.<br>
      <br>
      <blockquote type="cite"><font size="3"><font size="3"><font
              size="3"><font size="3"><font size="3"><font size="4">B)
                    Another question I have is: for the Imaginary part
                    of Coherence is not necessary to compute the
                    cross-spectrum with 'powandcsd', only the FFT, but
                    for the PLV, PPC or WPLI is that way too?</font></font></font></font></font></font></blockquote>
      I see some terminology issues here. Let me try to explain in a
      simple (aka least-mathematical I can think of) way:<br>
      <br>
      For all these connectivity measures, we need the phase information
      from the Fourier transform (FFT) to compute the cross-spectral
      density matrix (CSD). The CSD can be regarded as the equivalent in
      the frequency domain to the covariance matrix in the time domain,
      thus it is a measures how a certain channels activity is
      co-modulated with another channels activity (for a particular
      frequency) - makes pretty much sense to make use of this when
      computing connectivity, right? :)<br>
      As you might know, a Fourier transform returns complex numbers,
      where the imaginary part of this number contains phase
      information. When calling ft_freqanalysis, you can decide if it
      shall only return the (squared) real part of the frequency
      spectrum (cfg.output='pow'), or instead the full CSD (cfg.output =
      'powandcsd'). Alternatively, you can also let ft_freqanalysis
      return the raw Fourier coefficients (cfg.output='fourier'). From
      the Fourier coefficients, however, you can easily obtain the CSD
      or the power spectrum basically by multiplication the Fourier
      matrix with itself (transposed). All of these measures quantify
      the phase relation between channels across trials, and as phase
      information is coded in the imaginary part of the fourier output,
      thus for connectivityanalysis you need the CSD which can be
      obtained either by 'powandcsd' or by 'fourier'. <br>
      <br>
      I hope that somehow clarifies your questions.<br>
      <br>
      Best,<br>
      Jörn<br>
      <br>
      On 5/17/2013 5:45 PM, Gabriel Gonzalez Escamilla wrote:<br>
    </div>
    <blockquote cite="mid:9f89709b303dae2.51966cc4@upo.es" type="cite"><font
        size="3">Dear Fieltrip experts,<br>
        <br>
        I have my continuous data imported to fieldtrip with matlab, I'm
        looking for performing connectivity analysis between pairs of
        sensors, I have succed as:<br>
        data.trials {1xNepochs}; % <font size="3">N</font>epochs = 7,
        each epoch with 59 channels and 2000 samples<br>
        data.label {59x1};<br>
        data.time {1xNepochs};<br>
        <br>
        then, calculate only the FFT of all sensors as:<br>
        cfg=[];<br>
        cfg.output='fourier';<br>
        cfg.method='mtmfft';<br>
        cfg.taper='hanning';<br>
        cfg.foilim=[8.5 9.5];<br>
        cfg.tapsmofrq=0;<br>
        cfg.trials='all';<br>
        cfg.keeptrials='yes';<br>
        cfg.channel='all';<br>
        fourier=ft_freqanalysis(cfg, data)<br>
        as output I get:<br>
        dimord = 'rpttap_chan_freq'<br>
        freq= [1x9]<br>
        fourierspctrm=[7x59x9 double]<br>
        <br>
        Then compute the ima<font size="3">ginary part of coherency as:<br>
          <font size="3">cfg=[];<br>
            <font size="3">cfg.method ='cohe'</font>;<br>
            <font size="3">cfg.complex='imag';<br>
              <font size="3">cfg.channelc<font size="3">bm={'all'</font></font>
              'all'};<br>
            </font></font></font>coher = ft_connect<font size="3">iv<font
            size="3">ityanalysis </font></font>(cfg, fourier)<br>
        <font size="3">as output get: <br>
          <font size="3">dimord='chan_chan_freq';<br>
            <font size="3"><font size="3">cohspctrm=[59x59x9 double]</font></font>;<br>
            <font size="3">dof=7;</font><br>
          </font></font><br>
        <font size="4">I have two main questions:</font><br>
        <br>
        <font size="4">A) As you see, this makes an average over the
          epochs of each channel, and not over the samples (which in
          this case are the 9 frequencies of the FFT), And I would like
          to have the op</font><font size="3"><font size="4">posite, </font><font
            size="3"><font size="4">t<font size="4">his is, to</font>
              get the </font><font size="3"><font size="4">imaginary
                part of coherence for each epoch (repeti<font size="4">t</font>ion)
                on all my channels and not for each frequency, som<font
                  size="4">ething like: chan_chan_rpt or chancbm_rpt</font>,
              </font><font size="3"><font size="4">Is this possible?</font><br>
                <br>
                <br>
                <br>
                <font size="4">B) Another question I have is: for the
                  Imaginary part of Coherence is not necessary to
                  compute the cross-spectrum with 'powandcsd', only the
                  FFT, but for the PLV, PPC or WPLI is that way too?</font><br>
                <br>
                <br>
                <br>
                <br>
                Many thanks in advanced,<br>
                <font size="3">Gabriel.</font><br>
                <br>
              </font></font></font></font></font>
      <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>
    <br>
    <pre class="moz-signature" cols="72">-- 
Jörn M. Horschig
PhD Student
Donders Institute for Brain, Cognition and Behaviour 
Centre for Cognitive Neuroimaging
Radboud University Nijmegen 
Neuronal Oscillations Group
FieldTrip Development Team

P.O. Box 9101
NL-6500 HB Nijmegen
The Netherlands

Contact:
E-Mail: <a class="moz-txt-link-abbreviated" href="mailto:jm.horschig@donders.ru.nl">jm.horschig@donders.ru.nl</a>
Tel:    +31-(0)24-36-68493
Web: <a class="moz-txt-link-freetext" href="http://www.ru.nl/donders">http://www.ru.nl/donders</a>

Visiting address:
Trigon, room 2.30
Kapittelweg 29
NL-6525 EN Nijmegen
The Netherlands</pre>
  </body>
</html>