If you use 'mtmconvol' as a method for frequency analysis it could happen that the Time-Frequency Representation of your data looks like this:

This phenomenon is caused by the time domain data having a non-zero DC component. This component leaks into the estimates of all time-frequency points in a variable (but patterned) way. The reason why this actually happens is related to the exact algorithm with which the TFR is computed in ft_freqanalysis_mtmconvol. The algorithm takes (computational) advantage of the fact that convolution in the time domain is mathematically equivalent to multiplication in the frequency domain. To this end, a fast fourier transform is applied to the time domain data, and it is combined with the fourier transform of the tapered basis functions. Importantly, no taper is applied to the data prior to fourier transformation. This leads to spectral leakage of the DC component across the whole frequency range.
The solution to this problem is to demean your data prior to calling ft_freqanalysis:
cfg = []; cfg.demean = 'yes'; data = ft_preprocessing(cfg, data);
The following code shows the effect of a non-zero DC component on the TFR:
% create some data
data=[];
data.trial{1} = randn(1,1000) + 2.*ft_preproc_bandpassfilter(randn(1,1000), 1000, [25 45]);
data.trial{1}(2,:)= data.trial{1}(1,:)+100; % introduce big DC component
data.label = {'chan01';'chan02'}
data.time{1} = -0.5:0.001:0.499;
data.fsample = 1000;
% do tfr-decomposition
cfg = [];
cfg.method = 'mtmconvol';
cfg.toi = -0.4:0.01:0.4;
cfg.foi = 5:80;
cfg.taper = 'hanning';
cfg.t_ftimwin = 4./cfg.foi;
cfg.polyremoval = -1; % see below
freq = ft_freqanalysis(cfg, data)
% plot
figure;imagesc(freq.time,freq.freq,squeeze(freq.powspctrm(1,:,:)));axis xy; caxis([0 0.6]);
xlabel('time');ylabel('frequency');
figure;imagesc(freq.time,freq.freq,squeeze(freq.powspctrm(2,:,:)));axis xy; caxis([0 0.6]);
xlabel('time');ylabel('frequency');
Note that I specified the option cfg.polyremoval to be -1. This option has been introduced in July 2011, and is intended in its default behavior (the value in the default case is 1) to subtract first order linear trends from the data prior to the spectral analysis, thus aiming to avoid these surprising effects. A value of -1 is NOT the default behavior, because it will lead to no trend removal whatsoever, and therefore shows the strange behavior. The default value (which means that you don't have to worry about this) is 1, but you can also specify a higher value (removing higher order polynomes), a value of 0 (only removing the mean), or -1 (no removal at all).
Share this page: