Example #1
0
        public static int testdft2(double[] source)
        {
            var       t1  = Environment.TickCount;
            simplefft fft = new simplefft(source);

            Console.Write("dft-parallel:");

            System.Threading.Tasks.Parallel.For(0, source.Length, (i) => { fft.low_ft(i); });
            return(Environment.TickCount - t1);
        }
Example #2
0
        public static int testdft(double[] source)
        {
            var       t1  = Environment.TickCount;
            simplefft fft = new simplefft(source);

            Console.Write("dft-single:");
            for (int i = 0; i < source.Length; i++)
            {
                fft.low_ft(i);
            }
            return(Environment.TickCount - t1);
        }
Example #3
0
        public static void testRight(double[] source)
        {
            List <Complex> dft = new List <Complex>();
            simplefft      fft = new simplefft(source);

            for (int i = 0; i < source.Length; i++)
            {
                dft.Add(fft.low_ft(i));
            }
            Console.WriteLine("dft:");
            var ret = fft.simple_fft(source);

            for (int i = 0; i < source.Length; i++)
            {
                Console.WriteLine("{0},{1}", i, dft[i].ToString());
            }
            Console.WriteLine("fft:");
            for (int i = 0; i < source.Length; i++)
            {
                Console.WriteLine("{0},{1}", i, ret[i].ToString());
            }
        }