[FieldTrip] single-trial phase at stimulus onset using Hilbert transform

george michael gmichael_ at hotmail.com
Thu Jun 18 16:45:02 CEST 2020


Dear Jan- Mathijs,

thank you very much for the suggestion and the explanation.
I'll try your (and Tzvetan's) suggestion in using onepass-zerophase filter on a longer epoch.

Best regards,
Georgios

________________________________
From: fieldtrip <fieldtrip-bounces at science.ru.nl> on behalf of Schoffelen, J.M. (Jan Mathijs) <jan.schoffelen at donders.ru.nl>
Sent: Thursday, June 18, 2020 15:59
To: FieldTrip discussion list <fieldtrip at science.ru.nl>
Subject: Re: [FieldTrip] single-trial phase at stimulus onset using Hilbert transform

Dear Georgios,

Note that the default filter direction implemented for the ‘firws’ filter is onepass-zerophase. I recommend to use this (thus not to specify ‘onepass’), but in addition to widen up (as per Tzvetan’s suggestion) the epoch to avoid filter edge effects in your time window of interest.
Note that you ask for a very narrow passband on very short data segments. This is in principle not really meaningful, since narrow filters require long filterorders (i.e. they need to integrate the original signal in a long window). As long as they are integrating from the left only, the phase estimates won’t be affected by the stimulus induced transient.


Best wishes,

Jan-Mathijs


On 18 Jun 2020, at 14:44, george michael <gmichael_ at hotmail.com<mailto:gmichael_ at hotmail.com>> wrote:

Dear Tzvetan,

thanks you for the quick reply.
Wouldn't be a problem to use "onepass-zerophase" or "twopass" given that I am interested in phase at stimulus onset?
Don't both filter-types smear poststimulus activity into the prestimulus interval?

Best,
Georgios
________________________________
From: fieldtrip <fieldtrip-bounces at science.ru.nl<mailto:fieldtrip-bounces at science.ru.nl>> on behalf of Tzvetan Popov <tzvetan.popov at uni-konstanz.de<mailto:tzvetan.popov at uni-konstanz.de>>
Sent: Thursday, June 18, 2020 14:27
To: FieldTrip discussion list <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>>
Subject: Re: [FieldTrip] single-trial phase at stimulus onset using Hilbert transform

Dear Georgios,

the reason is your cfg.bpfiltdir = ‘onepass’. This should be zero phase or twopass filter. Yet, you will still get filter artefacts at the edges. I suggest you should re-segment your data, e.g. -1000 to 500ms, filter and then re-segment to -500 to 0 again.
Good luck,
tzvetan


Am 18.06.2020 um 14:14 schrieb george michael <gmichael_ at hotmail.com<mailto:gmichael_ at hotmail.com>>:

Dear Fieldtrip Community,

I am trying to extract the alpha phase at stimulus onset from single trials.
My approach is to :
1) Band-pass filter the trial segments from -500ms to 0 (±1Hz around individual alpha frequency).
I use the filter 'firws' and filter direction 'onepass' to avoid smearing poststimulus activity into the prestimulus interval.
2) Compute Hilbert transform to extract the instantaneous phase of the bandpass signal.
3) Select the phase at the last sample (t=0) as the one representing phase at stimulus onset.

 cfg=[];
cfg.channel = 'O1';
cfg.bpfilter='yes';
cfg.bpfreq=[foi-1 foi+1];
cfg.bpfilttype= 'firws';
cfg.bpfiltdir= 'onepass';
cfg.hilbert='angle';
phase = ft_preprocessing(cfg , trials_prestim);

 for tr=1:length(phase .trial)
       phase_onset(tr,:)=phase .trial{tr}(:,end); % select phase at last sample
 end

The problem is that the band-bass signal looks quite weird at the right edge, towards t=0s (see attached figure).

Do you have any idea what would be the reason for this problem?
And which would be the optimal way to extract phase at stimulus onset?

Many thanks,
Georgios
-----------------------
Georgios Michail, MSc.
Department of Psychiatry and Psychotherapy
Charite-Universitätsmedizin Berlin



<bandpass_alpha_singlesubj.png>_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=02%7C01%7C%7C7bffdb25339e4312d47408d8138fe865%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637280856278937631&sdata=d778USKwchQqJZ3ePP7C7BZJbufyB81gkt6CkzBYoaE%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202<https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=02%7C01%7C%7C7bffdb25339e4312d47408d8138fe865%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637280856278937631&sdata=%2FLrJA%2Bj0MtvBYuXJjlwnt2wRMXX%2BEkX870dq5WKqkj4%3D&reserved=0>

_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=02%7C01%7C%7C7bffdb25339e4312d47408d8138fe865%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637280856278947626&sdata=I2X%2BeAogYvdggJUmMRg4DeCVFe5j2bV9eXe5XbwUQgY%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202<https://eur06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=02%7C01%7C%7C7bffdb25339e4312d47408d8138fe865%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637280856278947626&sdata=Bx%2B63FzoG4fFNW%2FhNI0os1Wy%2FxOIzXfDiqUUHb%2BTNWw%3D&reserved=0>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200618/873c01de/attachment-0001.htm>


More information about the fieldtrip mailing list