[FieldTrip] functionality change in ft_freqanalysis

jan-mathijs schoffelen jan.schoffelen at donders.ru.nl
Fri Jul 1 10:31:10 CEST 2011

Dear all,

I made a slight change to the default behaviour of ft_freqanalysis. A good practice prior to doing spectral analysis is to remove the mean (and more often: the linear trend) from the time domain data, because if this is not done, it can lead to unexpected (at least unexpected to some) side effects. Some more documentation about this can be found at:


Anyway, we decided to let FieldTrip by default remove the first order linear trend from the time domain data, prior to doing the spectral analysis, thus avoiding unwanted side effects of the frequency transformation. This is now implemented in ft_freqanalysis when using the functions from the specest module (if you don't know what this 'specest' module means: don't worry, this is the default behaviour and you will be using it). 
You can overrule this trend removal by specifying the option cfg.polyremoval in ft_freqanalysis to be -1 (default = 1). You can also input different values to remove higher order polynomial trends (any value>1) or to just remove the mean value (cfg.polyremoval=0);

Note that if you use a fresh copy of FieldTrip (the change will be available in tonight's release version) that the behaviour is slightly changed with respect to before only if you didn't explicitly detrend your data prior to spectral analysis.

Happy fft'ing.


Dr. J.M. (Jan-Mathijs) Schoffelen 
Donders Institute for Brain, Cognition and Behaviour, 
Centre for Cognitive Neuroimaging,
Radboud University Nijmegen, The Netherlands
J.Schoffelen at donders.ru.nl
Telephone: 0031-24-3614793

More information about the fieldtrip mailing list