예제 #1
0
    private static void c8mat_sft_test()

    //****************************************************************************80
    //
    //  Purpose:
    //
    //    C8MAT_SFT_TEST tests C8MAT_SFTB and C8MAT_SFTF.
    //
    //  Licensing:
    //
    //    This code is distributed under the GNU LGPL license.
    //
    //  Modified:
    //
    //    22 June 2010
    //
    //  Author:
    //
    //    John Burkardt
    //
    {
        const int n1 = 10;
        const int n2 = 4;

        Console.WriteLine("");
        Console.WriteLine("C8MAT_SFT_TEST");
        Console.WriteLine("  C8MAT_SFTF computes the forward slow Fourier transform.");
        Console.WriteLine("  C8MAT_SFTB computes the backward slow Fourier transform.");
        Console.WriteLine("");
        Console.WriteLine("  The data has dimensions N1 = " + n1 + ", N2 = " + n2 + "");

        int seed = 123456789;

        Complex[] x = UniformRNG.c8mat_uniform_01_new(n1, n2, ref seed);

        typeMethods.c8mat_print_some(n1, n2, x, 1, 1, 10, 10, "  The original data:");
        //
        //  Compute the slow Fourier transform of the data.
        //
        Complex[] y = Slow.c8mat_sftf(n1, n2, x);

        typeMethods.c8mat_print_some(n1, n2, y, 1, 1, 10, 10, "  The Fourier coefficients:");
        //
        //  Now try to retrieve the data from the coefficients.
        //
        Complex[] x2 = Slow.c8mat_sftb(n1, n2, y);

        typeMethods.c8mat_print_some(n1, n2, x2, 1, 1, 10, 10, "  The retrieved data:");
    }