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

2009-06-10 Thread Béla MIHALIK
I made the transformations with scipy. It works with complex numbers.
The results are here:

http://server6.theimagehosting.com/image.php?img=second_fourier_scipy.png

Also i asked it from others... as i understand now: the second fourier
transformation of a function always gives back the mirror of the function
itself.
I didn't know it :-)

thanks,
   bela


2009/6/9 David Goldsmith d_l_goldsm...@yahoo.com


 Sorry, I meant:

  Im(iFT(FT(f))) = Im(FT^2(f)), Re(iFT(FT(f))) != Re(FT^2(f))

 DG

 --- On Tue, 6/9/09, David Goldsmith d_l_goldsm...@yahoo.com wrote:

  From: David Goldsmith d_l_goldsm...@yahoo.com
  Subject: Re: [Numpy-discussion] second 2d fft gives the same result as
 fft+ifft
  To: Discussion of Numerical Python numpy-discussion@scipy.org
  Date: Tuesday, June 9, 2009, 11:01 AM
 
  --- On Tue, 6/9/09, Matthieu Brucher matthieu.bruc...@gmail.com
  wrote:
 
   Hi,
  
   Is it really ?
   You only show the imaginary part of the FFT, so you
  can't
   be sure of
   what you are saying.
 
  Indeed, is there not a label for a function f which
  satisfies
 
   Im(iFFT(f)) = Im(FFT^2(f)),
  Re(iFFT(f)) != Re(FFT^2(f))?
 
  (And similarly if Im and Re roles are reversed.)
  Seems like the class of such functions (if any exist) might
  have some interesting properties...
 
  DG
 
   Don't forget that the only difference between FFT and
  iFFT
   is (besides
   of teh scaling factor) a minus sign in the exponent.
  
   Matthieu
  
   2009/6/9 bela bela.miha...@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?
   
I uploaded a screenshot about my result here:
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
   LinkedIn: http://www.linkedin.com/in/matthieubrucher
   ___
   Numpy-discussion mailing list
   Numpy-discussion@scipy.org
   http://mail.scipy.org/mailman/listinfo/numpy-discussion
  
 
 
 
  ___
  Numpy-discussion mailing list
  Numpy-discussion@scipy.org
  http://mail.scipy.org/mailman/listinfo/numpy-discussion
 



 ___
 Numpy-discussion mailing list
 Numpy-discussion@scipy.org
 http://mail.scipy.org/mailman/listinfo/numpy-discussion

___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


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

2009-06-09 Thread bela

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?

I uploaded a screenshot about my result here:
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


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

2009-06-09 Thread Matthieu Brucher
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
of teh scaling factor) a minus sign in the exponent.

Matthieu

2009/6/9 bela bela.miha...@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?

 I uploaded a screenshot about my result here:
 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
LinkedIn: http://www.linkedin.com/in/matthieubrucher
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


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

2009-06-09 Thread David Goldsmith

--- On Tue, 6/9/09, Matthieu Brucher matthieu.bruc...@gmail.com wrote:

 Hi,
 
 Is it really ?
 You only show the imaginary part of the FFT, so you can't
 be sure of
 what you are saying.

Indeed, is there not a label for a function f which satisfies 

 Im(iFFT(f)) = Im(FFT^2(f)), Re(iFFT(f)) != Re(FFT^2(f))?

(And similarly if Im and Re roles are reversed.)  Seems like the class of such 
functions (if any exist) might have some interesting properties...

DG

 Don't forget that the only difference between FFT and iFFT
 is (besides
 of teh scaling factor) a minus sign in the exponent.
 
 Matthieu
 
 2009/6/9 bela bela.miha...@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?
 
  I uploaded a screenshot about my result here:
  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
 LinkedIn: http://www.linkedin.com/in/matthieubrucher
 ___
 Numpy-discussion mailing list
 Numpy-discussion@scipy.org
 http://mail.scipy.org/mailman/listinfo/numpy-discussion
 


  
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


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

2009-06-09 Thread David Goldsmith

Sorry, I meant:

  Im(iFT(FT(f))) = Im(FT^2(f)), Re(iFT(FT(f))) != Re(FT^2(f))

DG

--- On Tue, 6/9/09, David Goldsmith d_l_goldsm...@yahoo.com wrote:

 From: David Goldsmith d_l_goldsm...@yahoo.com
 Subject: Re: [Numpy-discussion] second 2d fft gives the same result as 
 fft+ifft
 To: Discussion of Numerical Python numpy-discussion@scipy.org
 Date: Tuesday, June 9, 2009, 11:01 AM
 
 --- On Tue, 6/9/09, Matthieu Brucher matthieu.bruc...@gmail.com
 wrote:
 
  Hi,
  
  Is it really ?
  You only show the imaginary part of the FFT, so you
 can't
  be sure of
  what you are saying.
 
 Indeed, is there not a label for a function f which
 satisfies 
 
      Im(iFFT(f)) = Im(FFT^2(f)),
 Re(iFFT(f)) != Re(FFT^2(f))?
 
 (And similarly if Im and Re roles are reversed.) 
 Seems like the class of such functions (if any exist) might
 have some interesting properties...
 
 DG
 
  Don't forget that the only difference between FFT and
 iFFT
  is (besides
  of teh scaling factor) a minus sign in the exponent.
  
  Matthieu
  
  2009/6/9 bela bela.miha...@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?
  
   I uploaded a screenshot about my result here:
   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
  LinkedIn: http://www.linkedin.com/in/matthieubrucher
  ___
  Numpy-discussion mailing list
  Numpy-discussion@scipy.org
  http://mail.scipy.org/mailman/listinfo/numpy-discussion
  
 
 
       
 ___
 Numpy-discussion mailing list
 Numpy-discussion@scipy.org
 http://mail.scipy.org/mailman/listinfo/numpy-discussion
 


  
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion