# [Numpy-discussion] second 2d fft gives the same result as fft+ifft

Matthieu Brucher matthieu.brucher@gmail....
Tue Jun 9 10:36:18 CDT 2009

```Hi,

Is it really ?
You only show the imaginary part of the FFT, so you can't be sure of
what you are saying.
Don't forget that the only difference between FFT and iFFT is (besides

Matthieu

2009/6/9 bela <bela.mihalik@gmail.com>:
>
> I tried to calculate the second fourier transformation of an image with the
> following code below:
>
> ---------------------------------------------------------------
> import pylab
> import numpy
>
> ### Create a simple image
>
> fx = numpy.zeros( 128**2 ).reshape(128,128).astype( numpy.float )
>
> for i in xrange(8):
>        for j in xrange(8):
>                fx[i*8+16][j*8+16] = 1.0
>
> ### Fourier Transformations
>
> Ffx = numpy.copy( numpy.fft.fft2( fx ).real )   # 1st fourier
> FFfx = numpy.copy( numpy.fft.fft2( Ffx ).real )  # 2nd fourier
> IFfx = numpy.copy( numpy.fft.ifft2( Ffx ).real )   # inverse fourier
>
> ### Display result
>
> pylab.figure( 1, figsize=(8,8), dpi=125 )
>
> pylab.subplot(221)
> pylab.imshow( fx, cmap=pylab.cm.gray )
> pylab.colorbar()
> pylab.title( "fx" )
>
> pylab.subplot(222)
> pylab.imshow( Ffx, cmap=pylab.cm.gray )
> pylab.colorbar()
> pylab.title( "Ffx" )
>
> pylab.subplot(223)
> pylab.imshow( FFfx, cmap=pylab.cm.gray )
> pylab.colorbar()
> pylab.title( "FFfx" )
>
> pylab.subplot(224)
> pylab.imshow( IFfx, cmap=pylab.cm.gray )
> pylab.colorbar()
> pylab.title( "IFfx" )
>
> pylab.show()
> ---------------------------------------------------------------
>
> On my computer FFfx is the same as IFfx..... but why?
>
> http://server6.theimagehosting.com/image.php?img=second_fourier.png
>
> Bela
>
>
> --
> View this message in context: http://www.nabble.com/second-2d-fft-gives-the-same-result-as-fft%2Bifft-tp23945026p23945026.html
> Sent from the Numpy-discussion mailing list archive at Nabble.com.
>
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>

--
Information System Engineer, Ph.D.
Website: http://matthieu-brucher.developpez.com/
Blogs: http://matt.eifelle.com and http://blog.developpez.com/?blog=92