FFT and Parseval [message #88452] |
Mon, 28 April 2014 03:58  |
baptiste.cecconi
Messages: 1 Registered: April 2014
|
Junior Member |
|
|
Dear IDL guys,
I recently tried to check the conservation of energy (Parseval's theorem) through the IDL implementation of FFT, and I came to a somewhat surprising result.
Here a sample code that shows my point:
-----
N=1000
x = randomn(0,N) ; random series of data with 1000 elements
fft0 = fft(x,-1) ; fourier transform (to freq domain) of x
print,total(x^2.) ; total energy of the signal in time domain
print,total(abs(fft0)^2.)/N; total energy of the signal in freq domain (according to Parseval's theorem)
fft1 = fft(x,1) ; inverse fourier transform (freq to time domain) of x
print,total(abs(fft1)^2.)/N; total energy of the signal in freq domain (using inverse fft)
-----
From this little code, it is clear that
(1) total(x^2.) = total(abs(fft0)^2.)*N
(2) total(x^2.) = total(abs(fft1)^2.)/N
While quation (2) is fully consistent with Parseval's equation, (1) is not, by a N^2 factor.
In the IDL documentation, it is stated that "A normalization factor of 1/N, where N is the number of points, is applied during the forward transform." However, I'm not sure this solves anything here.
I have some difficulties to convince myself that the direct FFT transform is invoked with a negative "direction" parameter (as stated in IDL documentation).
Parseval theorem is recalled here:
http://en.wikipedia.org/wiki/Parseval's_theorem (see DFT equation)
|
|
|