# Questions about discrete signal energy calculation

I'm looking at the definition of signal energy (e.g. Wikipedia, cnx.org). For discrete signals, it's defined like the following, where $x(n)$ holds the signal:

$Energy = \sum_{n=-\infty}^{\infty} |x(n)|^2$

So my questions:

1. For a windowed, finite signal like double signal[256], the sum is from 1 to 256 (or 0 to 255 in a program) rather than $-\infty$ to $\infty$, right? (I don't even know how I would sum over infinity.)

2. Why does the energy formula have the absolute-value operator $|...|$? The result of taking the absolute value is squared anyways to produce a positive value, so taking the absolute value seems to be pointless. Is it because the $x(n)$ can be complex, so the absolute value of a complex number would be the scalar from Pythagoras' theorem?

• What do you mean by "the actual value is always obtained by mathematical manipulations rather than by explicit computation by adding terms"? How can you get a final actual value unless you do perform the summation? Mar 27, 2012 at 18:01
• Yes, I know the convergence of a geometric series sum. However, I don't see why that is useful here. Why would the values of $x(n)$ take the form of 1, $x$, $x^2$, $x^3$, ...? The signals that I'm reading (microphone, accelerometer, etc.) certainly don't have values like that. Mar 27, 2012 at 22:57
• I appreciate the help, but as I said, the data that I'm reading (e.g. from microphone, accelerometer) doesn't look like an exponentially decaying signal, or at least it doesn't look like it. Mar 27, 2012 at 23:35
• You're a mathematician and not an engineer, right? Mar 29, 2012 at 14:35

## 1 Answer

1. Yes. No need to sum up an infinite number of zeros.

2. Yes, it is because x(n) could be complex. If we didn't take the absolute values of the complex numbers (Euclidean norm), a signal containing $[\dots,0,0,a+ia, a-ia,0,0,\dots]$ would have an energy of zero (instead of $4a^2$) although it contains non-zero samples. For real numbers however $|a|^2 = a^2$ and the absolute value doesn't matter.