예제 #1
0
    private static void c4mat_sft_test()

    //****************************************************************************80
    //
    //  Purpose:
    //
    //    C4MAT_SFT_TEST tests C4MAT_SFTB and C4MAT_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("C4MAT_SFT_TEST");
        Console.WriteLine("  C4MAT_SFTF computes the forward slow Fourier transform.");
        Console.WriteLine("  C4MAT_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.c4mat_uniform_01_new(n1, n2, ref seed);

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

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

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