# How to calculate absolute power for EEG from power spectra density?

For example, I have power spectrum density calculated by pwelch

f = EEG.data;
f = f(2, :);
N = EEG.pnts;
Fs = EEG.srate;
NFFT = 2^nextpow2(N);
NOVERLAP = 0;
WINDOW = 512;
[spectra, freqs] = pwelch(x, WINDOW, NOVERLAP, NFFT,Fs);
deltaIdx = find(freqs>1 & freqs<4);
deltaPower = mean(spectra(deltaIdx));


The code comes from EEGLab, and can be found here: https://sccn.ucsd.edu/pipermail/eeglablist/2014/008043.html

How should I calculate absolute power from it? What's the relationship between absolute power and power spectrum density?

• @RobinKramer? seems like a good excuse for an exposition of power spectra
– honi
Apr 20 '17 at 3:33
• It seems so indeed. @Frederica, could you provide a little more context to your question. Where does that piece of code come from, and is there a reason you chose pwelch over FFT? Apr 20 '17 at 6:45
• @RobinKramer I've updated my code and resources in my question. From what I know, pwelch returns power spectra density with unit W/HZ. How does the mean of it gives absolute power with unit W? Apr 20 '17 at 18:27

I had to do some searching to be able to answer this question. As a matter of fact, a similar questions was once asked on Signal Processing.

To make the explanation more laymen-like, I think the answer means the following:

With pwelch or an FFT analysis you can calculate the amplitude of sinusoids with particular frequencies (see this answer ). These amplitudes squared, result in the absolute power within these specific frequencies. The resulting power per frequency is the power spectral density (PSD). In neuroscience, people do not often work with individual frequencies but work with frequency bands, such as the alpha band (8-14 Hz). This can be calculated by taking the average or the integral.

The absolute power (W), you referred to, is the power of the entire signal. It thus does not make a distinction between the different frequencies. This can be calculated, by summing the power of each frequency (i.e. taking the integral of the signal). By summing, you have the total amount of power within the signal. The absolute power can be used to normalize the PSD, by dividing the PSD by the absolute power (as described in the answer on Signal Processing).

Average vs integral

It seems that it is possible to calculate either the average or the integral of a frequency band. But when would you take the integral and when would you take the average? The average is an easy way of calculating how high the power is in a specific frequency band. This way, it does not matter how large the range of a frequency band is. The alpha band average will not be more inflated then the delta band (0-4 Hz) because of a bigger range.

When you take the integral there will exist differences that are affected by the size of the frequency band, because you do not divide the sum by the amount of samples (i.e frequencies). However, it does allow you to normalize the PSD with the absolute power. Say, the integral of the alpha band results in 2W, the integral of the delta band results in 1W, and the absolute power of the entire spectrum equals 10W. Then we know that the alpha band plays a 20% part and the delta band a 10% part in the total signal. With mere averaging, this would not be possible because we 'neglect' the size of the range.

I think it depends on what exactly you are after. I haven't work with the absolute power and am not familiar with it's user. Perhaps it has something to do with comparisons between exp. conditions (within frequency-bands, i.e. alpha vs alpha) or within exp. conditions (between frequency bands). If an actual expert could elaborate on why one method is beneficial over the other, that would be great.

• Thanks for your explanation. I'm still a little bit confused about the calculation of band power. From the answer on Signal Processing, the absolute band power is calculated by summing the power over the frequency band. Why it's calculated by taking the average in neuroscience? Apr 24 '17 at 15:33
• That is a good question. I looked into it and found that there actually is not a real difference between integrating and averaging. Where integrating is simply summing all the values, with averaging you sum all the values and divide it by the amount of values. I'll try to rephrase my answer a bit. Apr 25 '17 at 12:36