[FieldTrip] Time-frequency granger analysis

daniel.strahnen at uni-ulm.de daniel.strahnen at uni-ulm.de
Sat Jul 6 16:23:55 CEST 2019


Dear FieldTrip - Community,

 

My goal is to analyse changes of Granger Causality over a certain time
period.

Here is the code I use to calculate the wavelet analysis:

 

data.label = {'CH1'; 'CH2'; 'CH3'; 'CH4'; 'CH5'; 'CH6'; 'CH7'};

data.fsample = 1000; % Sampling rate of 1kH

data.time{1} = 1:600000;

data.trial{1} = Output_data'; % Matrix organised as follows: 7 chan x 600000
samples

 

%% Wavelets for time-frequency power analysis

cfg              = [];

cfg.output       = 'powandcsd';

cfg.method       = 'wavelet';

cfg.foi          = 1:48;     % Frequency range from 1 to 48Hz


cfg.t_ftimwin    = ones(length(cfg.foi),1).*0.5;   % length of time window =
0.5 sec

cfg.toi          = 0:600; % 600 seconds (10min) time period

freq_data          = ft_freqanalysis(cfg, data);

 

Up to this point everything seems to be correct, but the granger analysis
only gives my NaNs.

 

%% Granger causality analysis

cfg_conn = [];

cfg_conn.method = 'granger';

granger_str = ft_connectivityanalysis(cfg_conn, freq_data); 

 

Does anyone has a suggestion what might be the mistake in my code?

 

Thank you very much and best regards

 

Daniel

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190706/d666ded0/attachment-0001.html>
-------------- next part --------------
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202


More information about the fieldtrip mailing list