# [FieldTrip] problem with PLV and ImC computing

Gabriel Gonzalez Escamilla ggonesc at upo.es
Mon May 20 09:28:55 CEST 2013

```I'm re-sending this, becasue searching at the fieldtrip archives, I've notice that my message was scrubbed...

Dear Fieltrip experts,

I  have my continuous data imported to fieldtrip with matlab, I'm looking  for performing connectivity analysis between pairs of sensors, I have  succed as:
data.trials {1xNepochs}; % Nepochs = 7, each epoch with 59 channels and 2000 samples
data.label {59x1};
data.time {1xNepochs};

then, calculate only the FFT of all sensors as:
cfg=[];
cfg.output='fourier';
cfg.method='mtmfft';
cfg.taper='hanning';
cfg.foilim=[8.5 9.5];
cfg.tapsmofrq=0;
cfg.trials='all';
cfg.keeptrials='yes';
cfg.channel='all';
fourier=ft_freqanalysis(cfg, data)
as output I get:
dimord = 'rpttap_chan_freq'
freq= [1x9]
fourierspctrm=[7x59x9 double]

Then compute the imaginary part of coherency as:
cfg=[];
cfg.method ='cohe';
cfg.complex='imag';
cfg.channelcbm={'all' 'all'};
coher = ft_connectivityanalysis (cfg, fourier)
as output get:
dimord='chan_chan_freq';
cohspctrm=[59x59x9 double];
dof=7;

I have two main questions:

A)  As you see, this makes an average over the epochs of each channel, and  not over the samples (which in this case are the 9 frequencies of the  FFT), And I would like to have the opposite, this is, to get the imaginary part of coherence for each epoch (repetition) on all my channels and not for each frequency, something like: chan_chan_rpt or chancbm_rpt, Is this possible?

B)  Another question I have is: for the Imaginary part of Coherence is not  necessary to compute the cross-spectrum with 'powandcsd', only the FFT,  but for the PLV, PPC or WPLI is that way too?