Esempio n. 1
0
        private static void ShortTimeFourierTransform(IList <Complex> fftBuffer, FftDirection fftDirection)
        {
            var buffer = fftBuffer.Select(x => new[] { x.Real, x.Imaginary }).SelectMany(x => x).ToArray();

            ShortTimeFourierTransform(buffer, fftBuffer.Count, fftDirection == FftDirection.Forward ? -1 : 1);

            for (var i = 0; i < fftBuffer.Count; i++)
            {
                fftBuffer[i] = new Complex(buffer[i * 2], buffer[i * 2 + 1]);
            }
        }
Esempio n. 2
0
        private static void ShortTimeFourierTransform(IList<Complex> fftBuffer, FftDirection fftDirection)
        {
            var buffer = fftBuffer.Select(x => new[] {x.Real, x.Imaginary}).SelectMany(x => x).ToArray();

            ShortTimeFourierTransform(buffer, fftBuffer.Count, fftDirection == FftDirection.Forward ? -1 : 1);

            for (var i = 0; i < fftBuffer.Count; i++)
            {
                fftBuffer[i] = new Complex(buffer[i*2], buffer[i*2+1]);
            }
        }