[FieldTrip] Fieldtrip coherence calculation issue

Dengyu Wang wangdy1995 at gmail.com
Wed May 8 16:31:42 CEST 2019


Dear FieldTrip members,
I am using FieldTrip function ft_freqanalysis and ft_connectivityanalysis to calculate coherence coherence value between two channels, and I am following the tutorial: http://www.fieldtriptoolbox.org/tutorial/coherence/ <http://www.fieldtriptoolbox.org/tutorial/coherence/>.

The data used in the tutorial is:

It has 153 channels and 164 trials, and each trial is 1s long (1200 data points).

Then the following code is used to calculate the power spectrum and cross-spectral density:

cfg            = [];
cfg.output     = 'powandcsd';
cfg.method     = 'mtmfft';
cfg.foilim     = [5 100];
cfg.tapsmofrq  = 5;
cfg.keeptrials = 'yes';
cfg.channel    = {'MEG' 'EMGlft' 'EMGrgt'};
cfg.channelcmb = {'MEG' 'EMGlft'; 'MEG' 'EMGrgt'};
freq           = ft_freqanalysis(cfg, data);


It results in a data like this:


The data contains the power spectrum for each channel (n=153) and each trial (n=164), and the cross-spectral density for 302 channel combinations, for each trial (n=164).
 
And then this data is fed to ft_connectivityanalysis to calculate coherence between channel combinations specified in freq.labelcmb:

cfg            = [];
cfg.method     = 'coh';
cfg.channelcmb = {'MEG' 'EMG'};
fd             = ft_connectivityanalysis(cfg, freq);

And then we get data:



 I found that the resulting fd.cohspctrm has a dimension of ‘chancmb_freq’, and the dimension of “rpt” is gone, so I realize that the coherence here is calculated across trials. 
However, I would want to calculate the coherence value for each trial, so that I can have 164 (number of trials) coherence measures between two channels in stead of just one.

Could any one give me some suggestion? Or if I misunderstand something could any one point out to me? Thank you very much!

Best,
Dengyu



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190508/13c11062/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2019-05-08 at 10.18.03 AM.png
Type: image/png
Size: 32570 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190508/13c11062/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2019-05-08 at 10.21.31 AM.png
Type: image/png
Size: 50192 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190508/13c11062/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2019-05-08 at 10.23.56 AM.png
Type: image/png
Size: 30941 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190508/13c11062/attachment-0005.png>
-------------- 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