[FieldTrip] Frequency Analysis Coming Up with NaNs - related to removal of TMS artifcat?

Paul Dhami pdhami06 at gmail.com
Tue Sep 18 20:10:23 CEST 2018


Dear Fieldtrip community,

I have an TMS-EEG dataset, epoched from -1 to 1 second, with the trigger
being the TMS pulse. Due to the TMS pulse artifact, data from -5 ms to 10
ms is trimmed (removed and replaced with NaNs).

After importing the preprocessed data from eeglab using
eeglab2fieldtrip(EEG, 'preprocessing'), I tried running a multitaper TFR
analysis, with the code below being what I have used:

dataSPfreq              = eeglab2fieldtrip(EEG, 'preprocessing');

cfg = [];

cfg.output     = 'pow';

cfg.method     = 'mtmconvol';

cfg.foi        = 4:2:30;

cfg.t_ftimwin  = 2 ./ cfg.foi;

cfg.tapsmofrq  = 0.4 *cfg.foi;

cfg.toi        = -0.1:0.01:0.5;



dataSPfreq = ft_freqanalysis(cfg, dataSPfreq)


The output then is filled with NaNs.


I'm assuming it has something to do with the NaNs in the dataset, but then
when trying to select TOIs that shouldn't be affected by the NaN's, such
as:


dataSPfreq              = eeglab2fieldtrip(EEG, 'preprocessing');

cfg = [];

cfg.output     = 'pow';

cfg.method     = 'mtmconvol';

cfg.foi        = 4:2:30;

cfg.t_ftimwin  = 2 ./ cfg.foi;

cfg.tapsmofrq  = 0.4 *cfg.foi;

cfg.toi        = 0.1:0.01:0.6;



dataSPfreq = ft_freqanalysis(cfg, dataSPfreq)


with toi adjusted (which I believe should contain the appropriate time
window size for the lowest frequency at 0.5 s) I still end up with NaNs.


Sorry if there is an obvious mistake that I am missing. Any help with this
would be greatly appreciated.


Best,

Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20180918/479f5f2e/attachment-0001.html>


More information about the fieldtrip mailing list