예제 #1
0
        public void BandStop()
        {
            const double lowPassbandFreq     = 2000 / _SamplingFrequency;
            const double lowStopbandFreq     = 2500 / _SamplingFrequency;
            const double highPassbandFreq    = 3500 / _SamplingFrequency;
            const double highStopbandFreq    = 3000 / _SamplingFrequency;
            const double passbandRipple      = 5;
            const double stopbandAttenuation = 6;

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

            const int    expectedOrder      = 1;
            const double expectedCutoffLow  = 0.0953139584811423;
            const double expectedCutoffHigh = 0.19518335294151;

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