[Eeglablist] Understanding mean power calculations

Makoto Miyakoshi mmiyakoshi at ucsd.edu
Sat Jun 6 11:11:26 PDT 2020


Dear John,

Thank you for validating my code. In response, I uploaded my confirmation
process and results in the following URL.
https://sccn.ucsd.edu/wiki/Makoto%27s_useful_EEGLAB_code#Validation_.2806.2F06.2F2020_added.29

Here is the descriptive summary.
Imagine there are three power values, 11, 22, and 33. What do you want for
their average to be?
If you want 22 as the mean value, using my calculation is the choice.

The reason why you got the different value in your calculation is because
you directly averaged log-converted values in dB then convert it back to
uV^2. However, adding dB values means multiplication in the
non-log-converted world. The difference between your calculation and my
calculations is in whether averaging dB values first then convert to uV^2
(your calculation), or converting values to uV^2 then average (my Wiki).

That being said, see the following example.
The default newtimef() behavior is to calculate mean uV^2 values across
trials then dB-convert, rather than convert dB-trials first then average
(the latter is possible by specifying options.) Of course, this changes the
results, as you have shown! Why do we (or did EEGLAB developers) decide to
take the former not the latter? Is former correct and the latter wrong? If
so, then why did they bother to support the latter calculation by preparing
the dedicated option? John, your suggested calculation is in a sense
supported by this option in newtimef(). I can imagine your way of
calculation makes more sense under certain situations.

Makoto

On Thu, Jun 4, 2020 at 6:19 AM John Johnson <john.johnson at gatech.edu> wrote:

> Perhaps someone can help me understand. I occasionally run across
> [code](https://sccn.ucsd.edu/wiki/Makoto%27s_useful_EEGLAB_code) that
> takes the mean of decibel values, or the mean of power values, and
> treats them as being equivalent. It seems that using the mean of decibel
> values is not correct, since decibels are logarithmic values (i.e. the
> exponents of a base number, 10 in this case). For example:
>
> Mean power
> (10+100)/2 = 55
>
> Mean of log values (i.e. dB)
> n.b. 10 is 10^1, 100 is 10^2
>
> (1+2)/2 = 1.5, 10^1.5 = 31.6
>
> Using code modeled from the website linked above:
>
> % meanPowerDb(channelIdx) = mean(psdOutDb(channelIdx,
> lowerFreqIdx:higherFreqIdx));
> % meanPowerMicroV(channelIdx) = mean(10.^((psdOutDb(channelIdx,
> lowerFreqIdx:higherFreqIdx))/10), 2);
>
> dBs = [1, 3, 2, 4, 5, 1];
>
> meandB = mean(dBs)                              << 2.6667
>
> meanPower = mean(10.^(dBs/10))  << 1.962
>
> 10.^(meandB/10)                                 << 1.848
>
> So we can see that the mean of the dB values is artificially inflated.
> (10+100)/2 ≠ 10^((1+2)/2).
>
> Given the above, what is the correct way to find the mean power of a
> montage of electrodes?
>
> Thanks,
> John
>
> John T. Johnson
> PhD Candidate - Cognitive Motor Control Laboratory
> Lab TA NEURO 4001 Neuroscience Capstone
> School of Biological Sciences
> Georgia Institute of Technology
> john.johnson at gatech.edu
> he/him/his
> _______________________________________________
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to
> eeglablist-unsubscribe at sccn.ucsd.edu
> For digest mode, send an email with the subject "set digest mime" to
> eeglablist-request at sccn.ucsd.edu



More information about the eeglablist mailing list