Esempio n. 1
0
        public void IFFTPasses()
        {
            var input = Enumerable.Range(0, 8)
                        .Select(_i => new Complex(SoundUtils.CalSinWave(_i, 0.25f, 250f, 8000), 0))
                        .ToArray();
            var fft    = new FourierTransform();
            var output = fft.FFT(input);
            var gots   = fft.IFFT(output);

            AssertionUtils.AreEqualComplexArray(input, gots, "逆変換に失敗しています", EPSILON);
        }
Esempio n. 2
0
        public void FFTPasses()
        {
            var input = Enumerable.Range(0, 8)
                        .Select(_i => new Complex(SoundUtils.CalSinWave(_i, 0.25f, 250f, 8000), 0))
                        .ToArray();
            var fft    = new FourierTransform();
            var output = fft.FFT(input);

            //検証用のデータ作成
            var corrects = fft.FT(input);

            AssertionUtils.AreEqualComplexArray(corrects, output, "", EPSILON);
        }