0

I'm rewriting code from Matlab to C#. I'm completely newb at mathematics. I had to use FFT function which I found in AForge.net library, but now I need IFFT. Is this possible to use FFT to compute IFFT in few lines?

Aforge.Net FFT declaration:

 public static void FFT (Complex[] data, Direction direction)
apocalypse
  • 5,764
  • 9
  • 47
  • 95

1 Answers1

1

Inverse transform of an image, from ComplexImage.cs.

         FourierTransform.FFT2( data, FourierTransform.Direction.Backward );
            fourierTransformed = false;

            for ( int y = 0; y < height; y++ )
            {
                for ( int x = 0; x < width; x++ )
                {
                    if ( ( ( x + y ) & 0x1 ) != 0 )
                    {
                        data[y, x].Re *= -1;
                        data[y, x].Im *= -1;
                    }
                }
            }
Hayk Martiros
  • 2,146
  • 19
  • 21
  • They are the same, except for the data variable that gets passed being one vs two dimensional. `public static void FFT2( Complex[,] data, Direction direction )` `public static void FFT( Complex[] data, Direction direction )` – Hayk Martiros Aug 28 '12 at 18:23
  • I just set FourierTransform.Direction to Forward and it works. Idk what your example is doing... – apocalypse Aug 29 '12 at 14:41
  • I don't follow. Just set the direction to Forward for FFT and Backward for IFFT - isn't that your question? – Hayk Martiros Aug 29 '12 at 15:21