# [FieldTrip] global field power

Gio Piantoni g.piantoni at nin.knaw.nl
Fri Nov 9 09:09:35 CET 2012

```Hi,

There is an EEGLAB implementation of the original (Lehman's) GFP
https://sccn.ucsd.edu/svn/software/eeglab/external/bioelectromagnetism_ligth/eeg_gfp.m

I don't know of any code for Fieldtrip though.
Cheers,

G

On Fri, Nov 9, 2012 at 7:28 AM, Nathan Weisz <nathanweisz at mac.com> wrote:
> Hi,
>
> I think Nenad means something like (untested code):
> data.GFP=mean(data.avg.^2)
>
> or for
> data.RMS=sqrt(mean(data.avg.^2))
>
> Good luck,
> n
>
> On 08.11.2012, at 20:46, Eelke Spaak wrote:
>
>>
>> The only definition I could find for 'global field power' in the
>> context of EEG is indeed as JM suggested, the standard deviation over
>> channels. Of course, computing this std collapses across the channel
>> dimension, so you end up with a dimensionality of 1 where previously
>> there was the dimensionality of nChannels.
>>
>> If this is not what you are after, you need to give us a clear
>> definition of what you mean by 'global field power'.
>>
>> Best,
>> Eelke
>>
>> On 8 November 2012 20:34, Nenad Polomac <polomacnenad at gmail.com> wrote:
>>> Dear Jan and Elke,
>>>
>>> Thank you for your ansewers!
>>> I have applied The Matlabs std function on data.avg matrix and it doesn't
>>> give me good results. Namely, it returns matrix with  [1 x time points] so
>>> it reduces number of channels to one, which is not what I want. I believe
>>> this is because the sum function sums data column-wise. My question is could
>>> I do only sqrt(data.var). Would this result be proper way of calculating
>>> global field power?
>>>
>>> All the best!
>>>
>>>
>>> _______________________________________________
>>> fieldtrip mailing list
>>> fieldtrip at donders.ru.nl
>>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>> _______________________________________________
>> fieldtrip mailing list
>> fieldtrip at donders.ru.nl
>> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip
>
> _______________________________________________
> fieldtrip mailing list
> fieldtrip at donders.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/fieldtrip

```