[FieldTrip] NaN's in Wavelet TFR

Richard Bethlehem rb643 at medschl.cam.ac.uk
Mon May 25 20:15:04 CEST 2015


Dear Fieldtrippers,

This question has undoubtedly been asked before, but I could find clear guidance on how to work around it. When running ft_freqanalysis with wavelet decomposition I keep getting NaN's in all of my output. It would figure that this would be caused by insufficient data at the data borders, but I am (or at least think I am) not using that part of my epochs... So why am I still ending up with NaN's?

The data is from a 64-channel BioSemi system, sampled at 1k (and not downsampled), fairly 'standard' preprocessing with the addition of one channel repair and ICA artefact rejection (although in this one example dataset there was no clear ICA artefact component in the eyes-closed phase of the resting state). The data consist of two 50 second trials that are further segmented in 4s epochs).

The frequency code is below, the full script can be found at: https://github.com/rb643/fieldtrip_restingState/blob/master/restingstate.m

cfg_freq = [];
cfg_freq.method = 'wavelet';
cfg_freq.output = 'powandcsd';
cfg_freq.channel = 1:64;
cfg_freq.keeptrials ='yes'; %do not return an average of all trials for subsequent wpli analysis
cfg_freq.toi = [0.5:0.05:3.5]; %50ms time-window should give enough specificity
cfg_freq.foi = [0.5:0.02:4]; %delta range with increments of 0.02Hz
[freq_data.delta] = ft_freqanalysis(cfg_freq, data_iccleaned);
cfg_freq.foi = [4:0.02:7];
[freq_data.theta] = ft_freqanalysis(cfg_freq, data_iccleaned);
cfg_freq.foi = [7:0.02:13];
[freq_data.alpha] = ft_freqanalysis(cfg_freq, data_iccleaned);
cfg_freq.foi = [13:0.02:30];
[freq_data.beta] = ft_freqanalysis(cfg_freq, data_iccleaned);
cfg_freq.foi = [30:0.02:60];
[freq_data.gamma] = ft_freqanalysis(cfg_freq, data_iccleaned);

Cheers,

Richard

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150525/0a080473/attachment-0001.html>


More information about the fieldtrip mailing list