Exemplo n.º 1
0
        public static float[,] IFFT(ComplexFloat[,] input)
        {
            int rows    = input.GetLength(0);
            int columns = input.GetLength(1);

            ComplexFloat[,] result = new ComplexFloat[rows, columns];
            ComplexFloat[] tmpRow = new ComplexFloat[columns];
            ComplexFloat[] tmpCol = new ComplexFloat[rows];
            for (int i = 0; i < rows; i++)
            {
                tmpRow = IFFT(input.GetRow(i));
                for (int j = 0; j < columns; j++)
                {
                    result[i, j] = tmpRow[j];
                }
            }
            for (int i = 0; i < columns; i++)
            {
                tmpCol = IFFT(result.GetCol(i));
                for (int j = 0; j < rows; j++)
                {
                    result[j, i] = tmpCol[j];
                }
            }
            return(result.Convert());
        }
Exemplo n.º 2
0
        public static float[,] IFFT(ComplexFloat[,] input)
        {
            int rows    = input.GetLength(0);
            int columns = input.GetLength(1);

            ComplexFloat[,] result = new ComplexFloat[rows, columns];
            Parallel.For(0, rows, (i) =>
            {
                ComplexFloat[] tmpRow = IFFT(input.GetRow(i));
                for (int j = 0; j < columns; j++)
                {
                    result[i, j] = tmpRow[j];
                }
            });
            Parallel.For(0, columns, (i) =>
            {
                ComplexFloat[] tmpCol = IFFT(result.GetCol(i));
                for (int j = 0; j < rows; j++)
                {
                    result[j, i] = tmpCol[j];
                }
            });
            return(result.Convert());
        }