[R] Is R's fast fourier transform function different from fft2 in Matlab?

2007-05-02 Thread Li Li
Hi All, I found mvfft in R and fft2 in Matlab give different result and can't figure out why. My example is: In R: matrix(c(1,4,2,20), nrow=2) [,1] [,2] [1,]12 [2,]4 20 mvfft(matrix(c(1,4,2,20), nrow=2)) [,1] [,2] [1,] 5+0i 22+0i [2,] -3+0i -18+0i In Matlab:

Re: [R] Is R's fast fourier transform function different from fft2 in Matlab?

2007-05-02 Thread Sundar Dorai-Raj
Li Li said the following on 5/2/2007 4:06 PM: Hi All, I found mvfft in R and fft2 in Matlab give different result and can't figure out why. My example is: In R: matrix(c(1,4,2,20), nrow=2) [,1] [,2] [1,]12 [2,]4 20 mvfft(matrix(c(1,4,2,20), nrow=2)) [,1]

Re: [R] Is R's fast fourier transform function different from fft2 in Matlab?

2007-05-02 Thread Li Li
Thanks for both replies. Then I found the ifft2 from Matlab gives different result from fft( , inverse=T) from R. An example: in R: temp - matrix(c(1,4,2, 20), nrow=2) fft(temp) [,1] [,2] [1,] 27+0i -17+0i [2,] -21+0i 15+0i fft(temp,inverse=T) [,1] [,2] [1,] 27+0i -17+0i

Re: [R] Is R's fast fourier transform function different from fft2 in Matlab?

2007-05-02 Thread Robert A LaBudde
Discrete Fourier transforms can be normalized in different ways. Some apply the whole normalization to the forward transform, some to the reverse transform, some apply the square root to each, and some don't normalize at all (in which case the reverse of the forward transform will need

Re: [R] Is R's fast fourier transform function different from fft2 in Matlab?

2007-05-02 Thread Sundar Dorai-Raj
Li Li said the following on 5/2/2007 7:53 PM: Thanks for both replies. Then I found the ifft2 from Matlab gives different result from fft( , inverse=T) from R. An example: in R: temp - matrix(c(1,4,2, 20), nrow=2) fft(temp) [,1] [,2] [1,] 27+0i -17+0i [2,] -21+0i 15+0i