コード例 #1
0
ファイル: AlgorithmTest.cs プロジェクト: Jonarw/filter
        public void TestHalfSinc()
        {
            var target = new[]
            {
                1.000000000000000,
                0.996620203891810,
                0.986521922547816,
                0.969827881788617,
                0.946740650292526,
                0.917539710739792,
                0.882577424213710,
                0.842273951367101,
                0.797111210188940,
                0.747625965210988,
                0.694402156431365
            };

            var result = Dsp.HalfSinc(1000, 44100);

            FilterAssert.ListsAreReasonablyClose(target, result.Take(11).ToReadOnlyList());
            Assert.Throws <ArgumentOutOfRangeException>(() => Dsp.HalfSinc(-1, 44100).Take(1).ToReadOnlyList());
            Assert.Throws <ArgumentOutOfRangeException>(() => Dsp.HalfSinc(1000, -1).Take(1).ToReadOnlyList());
        }