[FieldTrip] Instantaneous phase shift and Hilbert transform

Schoffelen, J.M. (Jan Mathijs) jan.schoffelen at donders.ru.nl
Tue Mar 2 09:41:08 CET 2021


Hi He Yuxin,

I am not sure whether I really understand what you want to achieve (and what the underlying scientific question is), but:

in order to

> 1. Calculate instantaneous phase on every time point by Hilbert transform. 

you need to first bandpass filter your data, and then apply the Hilbert transform, retaining the angle. 
This can be achieved with a call to ft_preprocessing, using in the cfg the options:
cfg.bpilter = ‘yes’;
cfg.bpfreq = [low high] (put in the numbers you need)
cfg.bpfilttype = ‘firws’;
cfg.hilbert = ‘angle’;

> 2. Time series after stimulus onset subtract times series before stimulus onset. Thus, I can get individual phase shifts related to stimulus. 

I don’t understand this: after a stimulus event, it COULD make sense to evaluate the stimulus-evoked phase as a function of time, but I don’t think that it makes sense to compare this to individual phase estimates from before the stimulus event.

It could be that you mean to calculate intertrial coherence (ITC) or intertrial phase locking or so, in which case you’d evaluate the magnitude and/or phase of the trial-averaged complex-valued Hilbert transform. If it is indeed this that you are after, you’d need to specify cfg.hilbert = ‘complex’ in the above, and use some hand-crafted code for the ITC computation, although it could be that ft_timelockanalysis on the output of ft_preprocessing could already provide you with the complex-valued average.

Best wishes,
Jan-Mathijs


> 
> But, I have no idea how to realize it by FieldTrip. If anyone can help me, I will appreciate it very much. 
> 
> Best
> 
> He Yuxin 
> 
> 
> 
> 
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202




More information about the fieldtrip mailing list