[FieldTrip] RE : Best way of saving data in format that fieldtrip will understand

Robert Oostenveld r.oostenveld at donders.ru.nl
Tue Dec 10 14:23:39 CET 2013


Hi Ozan 

On 10 Dec 2013, at 13:48, Ozan Çağlayan wrote:
> 
> 1 second sampled at 5Hz would be [ 0.  ,  0.25,  0.5 ,  0.75,  1.  ]?
> Am I wrong?

No, at 5 Hz sampling frequency the distance between subsequent samples is 1/5 Hz = 0.2 seconds. So depending on whether you include the edges of the time interval or not, a time interval from 0 to 1 could be represented as

0.0 0.2 0.4. 0.6 0.8 1.0  % including both edges
0.2 0.4. 0.6 0.8 1.0 % including only the rightmost edge
0.0 0.2 0.4. 0.6 0.8 % including only the leftmost edge
0.2 0.4. 0.6 0.8 % not including the edges of the interval


In the case of a continuous recording of Nsamples at Fsample I would consider the best representation

data.trial{1} = randn(Nchans, Nsamples);
data.time{1} = ((1:nSamples)-1)/Fsample; % the first sample is at time=0, the last sample is at (nSamples-1)/Fsample
data.label = arrayfun(@num2str, 1:Nchans, 'UniformOutput', false)

See also http://fieldtrip.fcdonders.nl/faq/how_can_i_process_continuous_data_without_triggers,  http://fieldtrip.fcdonders.nl/faq/how_can_i_import_my_own_dataformat and http://fieldtrip.fcdonders.nl/faq/how_can_i_convert_one_dataformat_into_an_other

You might want to check out http://martinos.org/mne/mne-python.html and http://code.google.com/p/pyeeg/ for python code related to EEG data.

best regards,
Robert




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20131210/9e125053/attachment-0002.html>


More information about the fieldtrip mailing list