GFP on Epochs - Get vector

  • MNE-Python version: 0.21.0
  • operating system: Windows10

Hi,

  • I’ve 10 epochs all related to the event “sound X”. The duration of each epochs is 1 second.
  • I’ve 10 epochs all related to the event “sound Y”. The duration of each epochs is 1 second.
    I’d like to obtain a vector reporting, for each epoch of “sound X”, the GFP in Alpha related to specific channels (e.g. Fp1 and Fp3) . The resulting vector should be therefore of lenght 10.

Could you suggest a formula to obtain it?

:point_right: :point_right: :point_right: Thank you in advance :point_left: :point_left: :point_left:

Hello,

the GFP is simply the standard deviation of the signal at one time point across all channels.

Typically, you’d calculate it on evoked data (not epochs) for all time points. You can do it in the following way:

# first generate evokeds
evoked_sound_X = epochs['sound/X'].average()
evoked_sound_Y = epochs['sound/Y'].average()

# now get the GFPs
gfp_sound_X = evoked_sound_X.data.std(axis=0, ddof=0)
gfp_sound_Y = evoked_sound_Y.data.std(axis=0, ddof=0)

For this, I’d suggest you actually go back to your raw data, filter it accordingly (e.g., raw_alpha = raw.copy().filter(l_freq=8, h_freq=12)), and make new epochs & evokeds. Otherwise you might run into problems with edge artifacts (applying filters on relatively short epochs is never a great idea)

I’m not sure what this is supposed to mean? GFP always takes into account all sensors, and it implicitly applies an average referencing scheme.

thank you so much @richard, so useful information :wink:

1 Like