[FieldTrip] dimensions for coherence

Clara A. Scholl cas243 at georgetown.edu
Fri Apr 13 19:52:47 CEST 2012


Dear Fieldtrip users,

I'm encountering a problem with calculating coherence between two time
courses.  I suspect I'm misunderstanding something very basic.

When I calculate the coherence using data with multiple trials -- with
dimensions rpttap_chan_freq, everything works fine (I get a coherence
spectrum calculation that is averaged over the rpt dimension).
However if I want to limit the calculation to data with dimensions
chan_freq (i.e. find the coherence between the fourier spectra
(containing both amplitude and phase info) of a single timecourse on
two different channels (where those channels are specified using
cfg.channelcmb)), I get an error. I've tried to do this two different
ways.  If I still use the rpttap_chan_freq data, I tried specifying
cfg.trials=1 in the connectivity analysis input, and the error given
is:
??? 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{:});


->>If I input frequency data with dimensions chan_freq into
ft_connectivityanalysis (still only specifying cfg.method='coh' and
the channel combinations I'm interested in with cfg.channelcmb) the
output is:

??? Index exceeds matrix dimensions.

Error in ==> ft_checkdata>fixcsd at 843
      tmpdat1 = data.fourierspctrm(indx,cmbindx(:,1),:,:);

Error in ==> ft_checkdata at 629
    data = fixcsd(data, cmbrepresentation, channelcmb);

Error in ==> univariate2bivariate at 37
        data    = ft_checkdata(data, 'cmbrepresentation', 'sparse',
'channelcmb', cmb);

Error in ==> ft_connectivityanalysis at 320
          [data, powindx, hasrpt] = univariate2bivariate(data,
'fourierspctrm', 'crsspctrm', dtype, 'cmb', cfg.channelcmb, 'keeprpt',
normrpt);


->>Does the coherence calculation appear to require more than one
(complex) value at each channel & frequency band of interest? Am I
confused about what the rpttap dimension contains? My time window is
narrow and my fft calculation only has 1 taper, is that a problem?
Because the fourier calculation at each channel_frequency point
contains both amplitude and phase information, wouldn't data with
chan_freq dimensions be sufficient to calculate the cross spectral
densities between the fourier transforms of two channels?

Thanks for any guidance,
Clara



More information about the fieldtrip mailing list