Benaissa Tahiti
Benaissa Tahiti

Reputation: 75

How to calculate the energy spectrum of a signal?

I know by theory that the energy spectrum of a given signal is the sum of the squared fourier coefficient.

What if I have the real and imaginary part of the corresponding fourier coefficient, can I say that energy spectrum of a given signal is equal to sum of (real part + imaginary part)^2

Upvotes: 0

Views: 6746

Answers (2)

Heinz M.
Heinz M.

Reputation: 694

If result is a column vector with N elements, the energy spectrum is also a vector with N elements.

powerSpec = abs(result).^2;

The total energy can be calculated by

totalPower = sum(powerSpec);

or

totalPower = result' * result;

If result is a row vector you have to use

totalPower = result * result';

Upvotes: 0

hotpaw2
hotpaw2

Reputation: 70703

Not quite. You want:

sum of fft_result_magnitudes^2

which is:

sum of (sqrt(real_part^2 + imaginary_part^2)^2

which is:

sum of (real_part^2 + imaginary_part^2)

to get the sum of the squared magnitude of a complex FFT's results.

As for a fuller statement of Parseval's theorem, see:

http://en.wikipedia.org/wiki/Parseval%27s_theorem

Upvotes: 1

Related Questions