[FieldTrip] dimensions for coherence

Clara A. Scholl cas243 at georgetown.edu
Fri Apr 13 21:01:34 CEST 2012


Thank you Jan-Mathijs!

I was using the the coherence tutorial
(http://fieldtrip.fcdonders.nl/tutorial/coherence) but after reading
the connectivity tutorial I'm still confused.

A more parsimonious way to phrase my question would be:

Why do I get an error when my fourierspctrm with dimord
rpttap_chan_freq has dimensions of 1 x 128 x 10 (the key being, just 1
rpttap value for each channel x frequency combination)?

At each channel & frequency, fourierspctrum contains a complex value
so the data structure contains the phase and amplitude information at
each channel and frequency, which I think -- perhaps incorrectly --
should be sufficient to calculate the coherence.

I'll paste below an example of the error I'm getting, beginning with
the initial data structure through the ft_connectivityanalysis error.
IF the initial data structure (called tmp in this example) has rpt
size > 1, then I don't get the error.

Thanks,
Clara

tmp =

        label: {128x1 cell}
         time: [0.3380 0.3400 0.3420 0.3440 0.3460 0.3480 0.3500
0.3520 0.3540 0.3560 0.3580 0.3600 0.3620 0.3640 0.3660 0.3680 0.3700
0.3720]
          cfg: [1x1 struct]
        trial: [1x128x18 double]
   sampleinfo: [1 18]
       dimord: 'rpt_chan_time'

>> cfg=[];
cfg.output='fourier';
cfg.method='mtmfft';
cfg.tapsmofrq=28;
cfg.channel={'all'};

freqm0=ft_freqanalysis(cfg, tmp)

the input is timelock data with 128 channels and 18 timebins
processing trials
Warning: using only one taper for specified smoothing
> In specest/private/warning_once at 75
 In ft_specest_mtmfft at 96
 In ft_freqanalysis at 519
processing trial 1/1 nfft: 18 samples, datalength: 18 samples, 1 tapers
the call to "ft_freqanalysis" took 0 seconds and an estimated 0 MB

freqm0 =

           label: {128x1 cell}
          dimord: 'rpttap_chan_freq'
            freq: [0 27.7778 55.5556 83.3333 111.1111 138.8889
166.6667 194.4444 222.2222 250.0000]
   fourierspctrm: [1x128x10 double]
       cumsumcnt: 18
       cumtapcnt: 1
             cfg: [1x1 struct]

>> cfg=[];
cfg.method='coh';
cfg.channelcmb={'E34', 'E98'};
   fdm0=ft_connectivityanalysis(cfg, freqm0)
selection fourierspctrm along dimension 2

??? Index exceeds matrix dimensions.

Error in ==> ft_connectivity_corr at 131
     p1    = reshape(input(j,powindx(:,1),:,:,:), siz(2:end));

Error in ==> ft_connectivityanalysis at 471
   [datout, varout, nrpt] = ft_connectivity_corr(data.(inparam), optarg{:});



More information about the fieldtrip mailing list