来自AForge.Net的FFT的IFFT

时间:2012-08-28 14:38:02

标签: c# fft ifft

我将代码从Matlab重写为C#。我对数学非常陌生。我不得不使用我在AForge.net库中找到的FFT函数,但现在我需要IFFT。是否可以使用FFT在几行中计算IFFT?

Aforge.Net FFT声明:

 public static void FFT (Complex[] data, Direction direction)

1 个答案:

答案 0 :(得分:1)

来自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;
                    }
                }
            }
相关问题