Пример #1
0
    private static void TestConvolution(int size)
    {
        Complex[] input0vector = RandomComplexes(size);
        Complex[] input1vector = RandomComplexes(size);
        Complex[] refoutvector = new Complex[size];
        NaiveConvolve(input0vector, input1vector, refoutvector);

        Complex[] actualoutvector = new Complex[size];
        Fft.Convolve(input0vector, input1vector, actualoutvector);
        Console.WriteLine("convsize={0,4}  logerr={1,5:F1}", size, Log10RmsErr(refoutvector, actualoutvector));
    }
Пример #2
0
    private static void TestConvolution(int size)
    {
        double[] input0real = RandomReals(size);
        double[] input0imag = RandomReals(size);

        double[] input1real = RandomReals(size);
        double[] input1imag = RandomReals(size);

        double[] refoutreal = new double[size];
        double[] refoutimag = new double[size];
        NaiveConvolve(input0real, input0imag, input1real, input1imag, refoutreal, refoutimag);

        double[] actualoutreal = new double[size];
        double[] actualoutimag = new double[size];
        Fft.Convolve(input0real, input0imag, input1real, input1imag, actualoutreal, actualoutimag);

        Console.WriteLine("convsize={0,4}  logerr={1,5:F1}", size, Log10RmsErr(refoutreal, refoutimag, actualoutreal, actualoutimag));
    }