<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
Hi Richard,
<div>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.</div>
<div>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.</div>
<div>Best,</div>
<div>Jan-Mathijs</div>
<div><br>
<div>
<div>On May 25, 2015, at 8:15 PM, Richard Bethlehem <<a href="mailto:rb643@medschl.cam.ac.uk">rb643@medschl.cam.ac.uk</a>> wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div ocsi="0" fpstyle="1" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">
<div style="direction: ltr; font-family: Tahoma; font-size: 10pt;">Dear Fieldtrippers,<br>
<br>
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?<br>
<br>
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).<br>
<br>
The frequency code is below, the full script can be found at:<a href="https://github.com/rb643/fieldtrip_restingState/blob/master/restingstate.m" target="_blank">https://github.com/rb643/fieldtrip_restingState/blob/master/restingstate.m</a><br>
<br>
cfg_freq = [];<br>
cfg_freq.method = 'wavelet';<br>
cfg_freq.output = 'powandcsd';<br>
cfg_freq.channel = 1:64;<br>
cfg_freq.keeptrials ='yes'; %do not return an average of all trials for subsequent wpli analysis<br>
cfg_freq.toi = [0.5:0.05:3.5]; %50ms time-window should give enough specificity<br>
cfg_freq.foi = [0.5:0.02:4]; %delta range with increments of 0.02Hz<br>
[freq_data.delta] = ft_freqanalysis(cfg_freq, data_iccleaned);<br>
cfg_freq.foi = [4:0.02:7];<br>
[freq_data.theta] = ft_freqanalysis(cfg_freq, data_iccleaned);<br>
cfg_freq.foi = [7:0.02:13];<br>
[freq_data.alpha] = ft_freqanalysis(cfg_freq, data_iccleaned);<br>
cfg_freq.foi = [13:0.02:30];<br>
[freq_data.beta] = ft_freqanalysis(cfg_freq, data_iccleaned);<br>
cfg_freq.foi = [30:0.02:60];<br>
[freq_data.gamma] = ft_freqanalysis(cfg_freq, data_iccleaned);<br>
<br>
Cheers,<br>
<br>
Richard<br>
<br>
</div>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a></div>
</blockquote>
</div>
<br>
</div>
</body>
</html>