apocalypse
apocalypse

Reputation: 5884

IFFT from FFT in AForge.Net

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)

Upvotes: 0

Views: 1759

Answers (1)

Hayk Martiros
Hayk Martiros

Reputation: 2186

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;
                    }
                }
            }

Upvotes: 1

Related Questions