IDL FFT vs MATLAB FFT [message #32445] |
Tue, 08 October 2002 10:35 |
Randall Skelton
Messages: 169 Registered: October 2000
|
Senior Member |
|
|
Argh.... it is a bad day when I need to sort out both Matlab's and IDL's
FFT functions...
Assuming that, IDL's FFT function uses a one-sided format, and divides
by N on the forward transform and MATLAB's FFT function uses a
one-sided format and divides by N on the inverse transform, I still am
having difficulty comparing the FFT results from each.
In Matlab:
>> fft(eye(4))
ans =
1.0000 1.0000 1.0000 1.0000
1.0000 0 - 1.0000i -1.0000 0 + 1.0000i
1.0000 -1.0000 1.0000 -1.0000
1.0000 0 + 1.0000i -1.0000 0 - 1.0000i
IDL> print, 4*fft(identity(4),/double)
(1.0000000,0.0000000) (0.0000000, 0.0000000) (0.0000000,0.0000000) (0.0000000, 0.0000000)
(0.0000000,0.0000000) (0.0000000,-3.0628711e-17) (0.0000000,0.0000000) (1.0000000,3.0628711e-17)
(0.0000000,0.0000000) (0.0000000, 0.0000000) (1.0000000,0.0000000) (0.0000000, 0.0000000)
(0.0000000,0.0000000) (1.0000000,-3.0628711e-17) (0.0000000,0.0000000) (0.0000000,3.0628711e-17)
Can someone please explain how and why these are different?
Many thanks,
Randall
|
|
|