예제 #1
0
    private static void c8vec_sft_test()

    //****************************************************************************80
    //
    //  Purpose:
    //
    //    C8VEC_SFT_TEST tests C8VEC_SFTB and C8VEC_SFTF.
    //
    //  Licensing:
    //
    //    This code is distributed under the GNU LGPL license.
    //
    //  Modified:
    //
    //    10 June 2010
    //
    //  Author:
    //
    //    John Burkardt
    //
    {
        const int n = 36;

        Console.WriteLine("");
        Console.WriteLine("C8VEC_SFT_TEST");
        Console.WriteLine("  C8VEC_SFTF computes the forward slow Fourier transform.");
        Console.WriteLine("  C8VEC_SFTB computes the backward slow Fourier transform.");
        Console.WriteLine("");
        Console.WriteLine("  The number of data values, N = " + n + "");

        int seed = 123456789;

        Complex[] x = UniformRNG.c8vec_uniform_01_new(n, ref seed);

        typeMethods.c8vec_print_part(n, x, 10, "  The original data:");
        //
        //  Compute the slow Fourier transform of the data.
        //
        Complex[] y = Slow.c8vec_sftf(n, x);

        typeMethods.c8vec_print_part(n, y, 10, "  The Fourier coefficients:");
        //
        //  Now try to retrieve the data from the coefficients.
        //
        Complex[] x2 = Slow.c8vec_sftb(n, y);

        typeMethods.c8vec_print_part(n, x2, 10, "  The retrieved data:");
    }