[FieldTrip] Fieldtrip coherence calculation issue

Schoffelen, J.M. (Jan Mathijs) jan.schoffelen at donders.ru.nl
Thu May 9 09:01:13 CEST 2019


Dear Dengyu,

Coherence is by definition a measure that is computed across observations. When computed on a single trial (with only a single degree of freedom, which is usually the case, unless heavy multitapering or Welch type of spectral estimation techniques are used: and even then highly biased estimates with poor spetral resolution will be the result), the value of coherence BY DEFINITION will be 1.

If you nevertheless insist on a single trial estimate, you could consider using the jackknife (i.e. leave-one-out estimate) to estimate the single trial contribution to the ‘overall coherence’, optionally followed by the computation of so-called pseudovalues.

See for example this paper for some more inspiration:

https://science.sciencemag.org/content/316/5831/1609.long


Best wishes,
Jan-Mathijs

J.M.Schoffelen, MD PhD
Associate PI, VIDI-fellow - PI, language in interaction
Telephone: +31-24-3614793
Physical location: room 00.028
Donders Centre for Cognitive Neuroimaging, Nijmegen, The Netherlands


On 8 May 2019, at 16:31, Dengyu Wang <wangdy1995 at gmail.com<mailto:wangdy1995 at gmail.com>> wrote:

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/.

The data used in the tutorial is:
<Screen Shot 2019-05-08 at 10.18.03 AM.png>
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:
<Screen Shot 2019-05-08 at 10.21.31 AM.png>

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:
<Screen Shot 2019-05-08 at 10.23.56 AM.png>


 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



_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20190509/df2a40ab/attachment-0002.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