<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt">Thanks a lot for the fast responses. I'll try both methods and test whether there are differences in the results<br><br><div><span>Cheers<br></span></div><div> </div><div><span style="font-style:italic;">Lisandro Kaunitz<br></span><font size="2"><br></font><br></div><div style="display: block;" class="yahoo_quoted"> <br> <br> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 12pt;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 12pt;"> <div dir="ltr"> <font size="2" face="Arial"> El día jueves, 12 de diciembre de 2013 19:39, Jörn M. Horschig <jm.horschig@donders.ru.nl> escribió:<br> </font> </div>  <div class="y_msg_container">Hi Lisandro,<br
 clear="none"><br clear="none">actually, for me it works by just computing a time-frequency <br clear="none">representation and shoving that into ft_connectivityanalysis. Is there <br clear="none">an error if you try that? I literally do<br clear="none"><br clear="none">     cfg = [];<br clear="none">     cfg.channelcmb = ...;<br clear="none">     cfg.method    = 'granger';<br clear="none">     granger    = ft_connectivityanalysis(cfg, freq);<br clear="none"><br clear="none"><br clear="none">With freq obtained by<br clear="none"><br clear="none">       cfg           = [];<br clear="none">       cfg.method    = 'mtmconvol';<br clear="none">       cfg.output    = 'fourier';<br clear="none">       cfg.taper     = 'hanning';<br clear="none">       cfg.foi   
    = 1:32;<br clear="none">       cfg.t_ftimwin = 0.5.*ones(size(4./cfg.foi'), 1);<br clear="none">       cfg.toi       = -1:0.05:1;<br clear="none">       freq          = ft_freqanalysis(cfg, data);<br clear="none"><br clear="none">Otherwise, solution 2 is something that definitely works and what I also <br clear="none">did first, and it worked fine. There should be nothing wrong imho, as JM <br clear="none">also pointed out.<br clear="none"><br clear="none">Best,<br clear="none">Jörn<br clear="none"><div class="yqt8011866190" id="yqtfd02279"><br clear="none">Lisandro Kaunitz wrote:<br clear="none">> Hi,<br clear="none">><br clear="none">> Following the tutorial on connectivity analysis I am trying to <br clear="none">> implement Granger Causality on simulated signals. I can reproduce all <br clear="none">> the results that appear in the tutorial
 in my dataset but I cannot <br clear="none">> obtain a graph of Wavelet-based granger causality with the format:<br clear="none">><br clear="none">> -x axis: time<br clear="none">> -y axis: frequency<br clear="none">><br clear="none">> This  graph should allow me to compare in a single figure how channel <br clear="none">> 1 granger causes channel 2 at a range of frequencies as a function of <br clear="none">> time (like in Fig 3 of Dhamala et al, 2008).<br clear="none">><br clear="none">> My problem is that I cannot figure out how to produce this graph with <br clear="none">> the tutorial functions as they seem to automatically compute Granger <br clear="none">> Spectra for the whole epoch. In the tutorial demo the structure 'freq' <br clear="none">> has dimord: 'rpttap_chan_freq', and the structure 'granger' has <br clear="none">> dimord: 'chan_chan_freq'. What I am looking for is a function that <br
 clear="none">> returns a structure with the granger spectra computed with dimord of <br clear="none">> 'chan_chan_freq_time'<br clear="none">><br clear="none">> 1- I've tried running 'freq = ft_freqanalysis(cfg, data);' and then <br clear="none">> '[output] = ft_connectivity_csd2transfer(freq);' with all types of <br clear="none">> parameters but I could not reach to a solution. Is there a way of <br clear="none">> building a time-frequency granger spectra within fieldtrip?<br clear="none">><br clear="none">> 2- Alternatively to 1, I thought that I could compute non-parametric <br clear="none">> Granger Spectra for different time windows inside each epoch and then <br clear="none">> concatenate the results. Before doing this I would like to be sure <br clear="none">> that I am not missing a way of doing it that it's already implemented <br clear="none">> in fieldtrip (I have just started using Fieldtrip a short
 time ago)<br clear="none">><br clear="none">> Thanks a lot<br clear="none">><br clear="none">> Cheers<br clear="none">><br clear="none">><br clear="none">> Lisandro Kaunitz</div><br clear="none">><br clear="none">><br clear="none">><br clear="none">><br clear="none">> _______________________________________________<br clear="none">> fieldtrip mailing list<br clear="none">> <a shape="rect" ymailto="mailto:fieldtrip@donders.ru.nl" href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br clear="none">> <a shape="rect" href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br clear="none"><br clear="none"><br clear="none">-- <br clear="none">Jörn M. Horschig<br clear="none">PhD Student<br clear="none">Donders Institute for Brain, Cognition and Behaviour<br clear="none">Centre for Cognitive Neuroimaging<br
 clear="none">Radboud University Nijmegen<br clear="none">Neuronal Oscillations Group<br clear="none">FieldTrip Development Team<br clear="none"><br clear="none">P.O. Box 9101<br clear="none">NL-6500 HB Nijmegen<br clear="none">The Netherlands<br clear="none"><br clear="none">Contact:<br clear="none">E-Mail: <a shape="rect" ymailto="mailto:jm.horschig@donders.ru.nl" href="mailto:jm.horschig@donders.ru.nl">jm.horschig@donders.ru.nl</a><br clear="none">Tel:    +31-(0)24-36-68493<br clear="none">Web: <a shape="rect" href="http://www.ru.nl/donders" target="_blank">http://www.ru.nl/donders</a><br clear="none"><br clear="none">Visiting address:<br clear="none">Trigon, room 2.30<br clear="none">Kapittelweg 29<br clear="none">NL-6525 EN Nijmegen<br clear="none">The Netherlands<div class="yqt8011866190" id="yqtfd60504"><br clear="none"><br clear="none"></div><br><br></div>  </div> </div>  </div> </div></body></html>