Can you count signal energy equivalent in frequency domain?

I read about method of analyzing audio signals where FFT result is bandpass-filtered and the energy of this band is counted. Can you count the momentary energy in frequency domain? Does this mean summing magnitude value from all frequency bins (after filtering)?

(I don't care whether this will yield the value similar to the one counted in time domain but just if this can be of some benefit - reflect the energy present within this band.)

Parseval's theorem applied to the signal itself:

$$\sum_{n=0}^{N-1}|x[n]|^2 = \frac{1}{N}\sum_{k=0}^{N-1}|X[k]|^2$$

So, if you sum the magnitude squared of the frequency coefficients of the DFT, you get the energy of your time-domain vector.

If you want power (i.e. energy per sample), divide both sides by $N$.

• How does this change for FFT lengths not equal to the original length of the signal? Commented Oct 10, 2012 at 0:52
• It doesn't change. For the above statement of Parseval's theorem, the "signal" is by definition $x[n]$ and has length $N$ samples. Its transform $X[k]$ therefore also has $N$ samples. If you apply the relation to some subset (with length $N'$ from the larger length-$N$ signal, then you effectively have a new $x[n]$, and the relation holds over the new length $N'$. Commented Oct 10, 2012 at 2:38
• The index for the summation on the right hand side should be $k$ rather than $n$. This edit is too short for me to do silently, unfortunately.
– Eric
Commented Oct 10, 2012 at 4:39
• Commented Oct 10, 2012 at 21:41
• @JasonR Thanks, I didnt see your answer since my name wasnt tagged. Either way, yes, since a larger size FFT just means we have zero-padded the time-domain signal, it shouldnt/cant change. Commented Oct 11, 2012 at 19:18