bug in freqanalysis_mtmfft in case of non-dpss tapers and variable trial length

Robert Oostenveld r.oostenveld at FCDONDERS.RU.NL
Thu Dec 11 17:02:14 CET 2008

Dear all,

I just identified and fixed a bug in freqanalysis_mtmfft. The bug
caused an incorrect scaling of non-dpss tapers in case of variable
trial length. Multitapers (cfg.taper=dpss) are not affected, and data
in which all trials are of equal length are also not affected.

The bug became apparent to me when I compared hanning-tapered power
estimates in which some trials were missing some samples versus the
same data in which all trials were of exactly equal length. The power
difference between those two was a factor ~100x, whereas the
difference was that in one condition the data of a few trials was one
sample too short.

The consequence of the taper not being scaled/normalized correctly is
that all frequencies are multiplied by a fixed amount. The overall
shape of the power spectrum will not look different, it is just
multiplied with a fixed amount. Comparing two datasets with variable
trial length for both conditions is also not affected (the absolute
power values will both be off with a similar factor). There are cases
thinkeable in which the bug will have caused problems in the
subsequent analysis, e.g. in the data that I was analyzing. The
problem was quite obvious: a factor ~100 difference between the power
spectra in the two conditions, where that factor 100 was frequency

Sorry for the inconvenience that it may have caused.

best regards,

PS for the external users: the fixed version will be uploaded to the
ftp server this evening around 22h CET.

Robert Oostenveld
Senior Researcher
Donders Institute for Brain, Cognition and Behaviour
Centre for Cognitive Neuroimaging
Radboud University Nijmegen
tel.: +31 (0)24 3619695
e-mail: r.oostenveld at donders.ru.nl
web: http://www.ru.nl/neuroimaging

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.

More information about the fieldtrip mailing list