[FieldTrip] dimensions for coherence

jan-mathijs schoffelen jan.schoffelen at donders.ru.nl
Fri Apr 13 20:28:31 CEST 2012


Hi Clara,

Did you check the tutorial on the website? 

http://fieldtrip.fcdonders.nl/tutorial/connectivity

The input data to ft_connectivityanalysis has some requirements.
For coherence, you either need a freq-structure containing a 'fourierspctrm' field, or a 'crsspctrm' (+ 'powspctrm') field. The 'fourierspctrm' by definition should have a dimord of 'rpttap_chan_freq(_time', and the 'crsspctrm' may have lost the 'rpt' or 'rpttap' dimension. If your freq data looks different, you will not be able to compute coherence. Admittedly, the error messages you get are quite unspecific, but given the scarce information you are providing with respect to what exactly you have been doing, I can only give some general advice and point you to the documentation.

Best,

Jan-Mathijs


On Apr 13, 2012, at 7:52 PM, Clara A. Scholl wrote:

> 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
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip

Jan-Mathijs Schoffelen, MD PhD 

Donders Institute for Brain, Cognition and Behaviour, 
Centre for Cognitive Neuroimaging,
Radboud University Nijmegen, The Netherlands

Max Planck Institute for Psycholinguistics,
Nijmegen, The Netherlands

J.Schoffelen at donders.ru.nl
Telephone: +31-24-3614793

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20120413/d3f16f34/attachment-0002.html>


More information about the fieldtrip mailing list