[FieldTrip] Padding with mtmfft and mtmconvol

Vladimir Litvak litvak.vladimir at gmail.com
Wed Sep 20 12:56:01 CEST 2017


Dear Fieldtrippers,

I'm looking into an issue of one of SPM users who gets different results
when doing TF decomposition compared to computing a spectrum for the same
time window. I'm not sure I got to the bottom of it yet but one thing I
found is that ft_specest_mtmfft and ft_specest_mtmconvol are affected
differently by increasing padding. For short padding the results are
similar but with increasing padding there are differences both in offset of
the spectrum and its overall shape. See attached images where the top one
shows original spectra and the bottom one aligns the lowermost bin to zero.

Is this a bug or a feature?

Below is the script that produces these plots. I could provide the data as
well but this could probably be reproduced with any data.

Thanks,

Vladimir


-------------------------------------

pad = 0.5;%1%10


freqoi = 5:45;
timwin = 0.4+0*freqoi;

[spectrum,ntaper,freqoi,timeoi] = ft_specest_mtmconvol(data, time, 'taper',
'hanning', 'timeoi', 1.2, 'freqoi', freqoi,...
    'timwin', timwin, 'tapsmofrq', 1, 'verbose', 0, 'pad', pad);

s1 = squeeze(mean(mean(abs(spectrum), 4), 2));

figure;
subplot(2,1,1)
plot(freqoi, s1);
subplot(2,1,2);
plot(freqoi, s1-s1(1));
%%
[spectrum,ntaper,freqoi] = ft_specest_mtmfft(data, time, 'taper',
'hanning', 'freqoi', freqoi,...
    'tapsmofrq', 1, 'verbose', 0, 'pad', pad);

s2 = squeeze(mean(mean(abs(spectrum), 2), 1));

subplot(2,1,1)
hold on
plot(freqoi, s2, 'r');
subplot(2,1,2)
hold on
plot(freqoi, s2-s2(1), 'r');
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20170920/793b8ebd/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pad0_5.png
Type: image/png
Size: 4854 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20170920/793b8ebd/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pad1.png
Type: image/png
Size: 5013 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20170920/793b8ebd/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pad10.png
Type: image/png
Size: 4663 bytes
Desc: not available
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20170920/793b8ebd/attachment-0005.png>


More information about the fieldtrip mailing list