[FieldTrip] NaN's in Wavelet TFR
Schoffelen, J.M. (Jan Mathijs)
jan.schoffelen at donders.ru.nl
Mon May 25 20:52:56 CEST 2015
Hi Richard,
Is there a specific reason you would want to do a time-frequency type of analysis (with averaging across ‘epochs’ for resting state data? Since there’s no external event, such analysis does not really make sense.
Yet, if you insist on doing this, you need to ensure that the individual ‘pseudo-trial’ time axis (i.e. data_iccleaned.time{x}) contains a ‘pseudo-time-axis’ such that it goes from 0 to 4.
Best,
Jan-Mathijs
On May 25, 2015, at 8:15 PM, Richard Bethlehem <rb643 at medschl.cam.ac.uk<mailto:rb643 at medschl.cam.ac.uk>> wrote:
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
_______________________________________________
fieldtrip mailing list
fieldtrip at donders.ru.nl<mailto:fieldtrip at donders.ru.nl>
http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20150525/f703d247/attachment-0002.html>
More information about the fieldtrip
mailing list