コード例 #1
0
        public void BandPass()
        {
            const double lowPassbandFreq     = 2500 / _SamplingFrequency;
            const double lowStopbandFreq     = 2000 / _SamplingFrequency;
            const double highPassbandFreq    = 3000 / _SamplingFrequency;
            const double highStopbandFreq    = 3500 / _SamplingFrequency;
            const double passbandRipple      = 5;
            const double stopbandAttenuation = 6;

            var(n, w1, w2) = Designer.BandPass(lowStopbandFreq, lowPassbandFreq, highPassbandFreq, highStopbandFreq, passbandRipple, stopbandAttenuation);

            const int    expectedOrder      = 1;
            const double expectedCutoffLow  = 0.1287104733860468;
            const double expectedCutoffHigh = 0.1457165559830869;

            Assert.AreEqual(expectedOrder, n);
            Assert.AreEqual(expectedCutoffLow, w1, _Tolerance);
            Assert.AreEqual(expectedCutoffHigh, w2, _Tolerance);
        }