Exemplo n.º 1
0
        public void TransformBackwardInPlace()
        {
            int size  = 4096;
            var pffft = new PFFFT(size, Transform.Real);
            var data  = new float[size];

            pffft.Backward(data);
        }
Exemplo n.º 2
0
        public void TransformBackward()
        {
            int size    = 4096;
            var pffft   = new PFFFT(size, Transform.Real);
            var dataIn  = new float[size];
            var dataOut = new float[size];

            pffft.Backward(dataIn, dataOut);
        }
Exemplo n.º 3
0
        public void TransformForwardAndBackward()
        {
            int size     = 4096;
            var pffft    = new PFFFT(size, Transform.Real);
            var dataIn   = new float[size];
            var dataOut  = new float[size];
            var dataBack = new float[size];

            var generator = new SineGeneratorStream(4096, 100, TimeSpan.FromSeconds(1));

            generator.Read(dataIn, 0, size);

            pffft.Forward(dataIn, dataOut);
            pffft.Backward(dataOut, dataBack);

            CollectionAssert.AreEqual(dataIn, dataBack, new FFTComparer());
        }