[FieldTrip] Time normalisation for trials of different lenghts

Benedikt Ehinger behinger at uos.de
Tue Sep 12 20:14:22 CEST 2017


Dear Manuel,

first off, I do not know if or how you can do this in fieldtrip. But in
eeglab you can do something they call "timewarping". One calculates a
time-frequency (TF) decomposition for each trial and then
warps/interpolates the TF so that some given events align. This is very
similar (identical?) to what you describe and you might find more
information either in the papers or the eeglab implementation. The
method has been described in Gwin 2010 [1] and we also used it in on of
our own studies [2].

Whether you can do the same also for phase (=> coherence) I don't know.

I hope that helps in your analysis.
Best, Benedikt

[1] https://www.ncbi.nlm.nih.gov/pubmed/20410364
[2] https://www.ncbi.nlm.nih.gov/pubmed/24616681


Am 11.09.2017 um 14:32 schrieb Bange, Manuel:
> Dear fieldtrip community,
> 
>  
> 
> My name is Manuel Bange and I am working in the Movement Disorder and
> Neurostimulation Lab in Mainz, Germany. Currently I am working on a
> project where we recorded EEG and EMG data combined with simultaneously
> recorded ground reaction forces during walking on a treadmill. I intend
> to use complete gait cycles as trials in order to, for example,
> calculate the inter-trial coherence. The issue I now face is that every
> cycle lasts a different amount of time.
> 
> In a first step I have separated the continuous data into trials that
> correspond to whole gait cycles. One cycle starts with the onset of the
> right foot and ends one sample before the following onset of the same
> foot. This results in a number of trials (around 18 per subject) of
> different lengths.
> 
> Following this, I performed a time-frequency analysis for each
> individual trial by
> 
>  
> 
> 1.       selecting a specific trial
> 
> /cfg.trials      = 2;
>                                                               % select a
> a trial, here trial 2/
> 
> /trial2 = ft_selectdata(cfg, data)/
> 
> / /
> 
> 2.       performing time-frequency analysis
> 
> /cfg          = [];/
> 
> /cfg.output   = 'pow';/
> 
> /cfg.method   = 'mtmconvol';/
> 
> /cfg.taper    = 'hanning';/
> 
> /cfg.foi      = [1:1:40];/
> 
> /cfg.t_ftimwin    = ones(length(cfg.foi),1).*1;/
> 
> /cfg.toi          =
> trial2.time{1,1}(1,125):0.01:trial2.time{1,1}(1,end-125-1);            /
> 
> /cfg.keeptrials = 'yes'/
> 
> /data_tfa1     = ft_freqanalysis(cfg, trial2);/
> 
> /resulting in/
> 
> /  data_tfa1 = /
> 
> /  struct with fields:/
> 
> /label: {257×1 cell}/
> 
> /dimord: 'rpt_chan_freq_time'/
> 
> /freq: [1×40 double]/
> 
> /time: [1×172
> double]                                                                   
> % differs for each trial/
> 
> /powspctrm: [1×257×40×172 double]/
> 
> /cumtapcnt: [1×40 double]/
> 
> /cfg: [1×1 struct]/
> 
>  
> 
> Now my question is:
> 
> Is there a way to normalise this data over the time-axis, so that all
> trials have the same length? This is important to calculate an average
> time-frequency representation, or in another step, to calculate the
> inter-trial coherence. I have thought of normalising the time axis and
> interpolating the corresponding power-values.
> 
>  
> 
> Thanks and best regards,
> 
>  
> 
> Manuel Bange
> 
> M.Sc. Sports Science
> 
>  
> 
>  
> 
> Johannes-Gutenberg-University Hospital
> 
> Movement Disorders and Neurostimulation
> 
> Department of Neurology
> 
> Langenbeckstr. 1
> 
> 55131 Mainz, Germany
> 
> www.unimedizin-mainz.de
> 
>  
> 
> Email: manuel.bange at unimedizin-mainz.de
> 
>  
> 
> 
> 
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> 



More information about the fieldtrip mailing list