# wavelet analysis!

Alexander Maye a.maye at UKE.DE
Thu Jun 14 11:26:09 CEST 2007

```Dear experts!

When I compute coherence (using 'freqdescriptives') based on a frequency
transform using 'freqanalysis_wltconvol', I get coherence values larger than
1. This has also been observed by Muthuraman before.

The script below demonstrates this observation and also that
freqanalysis_mtmconvol does everything correctly. I think the problem is
pertinent to all current fieldtrip versions.

While I can easily switch to mtmconvol I thought it could be useful to
address this issue. Does anyone have an idea?

Best,

ALEX.

% Construct 4 trials with a sine wave in two channels ...
t=[0:1/pi:100*pi];
data.trial{1} = [sin(t);sin(t)];
data.time{1} = t/pi/10;
for i = 2:4, data.trial{i}=data.trial{1};data.time{i}=data.time{1}; end
data.label = {'1' '2'};
data.fsample = 10*pi;

cfgmtm.method = 'mtmconvol';
cfgmtm.tapsmofrq = 10;
cfgmtm.t_ftimwin = 0.2;
cfgmtm.output = 'powandcsd';
cfgmtm.keeptrials = 'yes';
cfgmtm.toi = 5;
cfgmtm.foi = 10;

cfgwlt.method = 'wltconvol';
cfgwlt.width = 5;
cfgwlt.output = 'powandcsd';
cfgwlt.keeptrials = 'yes';
cfgwlt.toi = 5;
cfgwlt.foi = 10;

fmtm = freqanalysis(cfgmtm,data);
fwlt = freqanalysis(cfgwlt,data);

cohcfg.cohmethod = 'coh';
cohcfg.complex = 'abs';
cohmtm = freqdescriptives(cohcfg,fmtm);
cohwlt = freqdescriptives(cohcfg,fwlt);

% ... should yield a coherence of 1 ...
cohmtm
% ... but this doesn't :-(
cohwlt

----------------------------------
The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also http://listserv.surfnet.nl/archives/fieldtrip.html and http://www.ru.nl/fcdonders/fieldtrip.

```