Re: IDL FFT vs MATLAB FFT [message #32443] |
Tue, 08 October 2002 11:01  |
Don J Lindler
Messages: 19 Registered: April 2001
|
Junior 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?
>
fft in matlab only does a 1-D transform. Use fft2.
Don
|
|
|