Exemple #1
0
    def test_get_cefficients(self):
        B = (0.1, 0.2, 0.3)
        A = (0.4, 0.5, 0.6)
        f = linearfilter.Filter(B, A, fs=48000)
        print(f)

        self.verify_coefficients(f, B, A)
Exemple #2
0
    def test_set_cefficients(self):
        B = (0.7, 0.8, 0.9)
        A = (1.1, 1.2, 1.3)
        f = linearfilter.Filter(fs=48000)
        f.set_coefficients(B, A)
        print(f)

        self.verify_coefficients(f, B, A)
Exemple #3
0
    def test_normalise(self):
        B = (0.1, 0.2, 0.3)
        A = (0.4, 0.5, 0.6)
        f = linearfilter.Filter(B, A, fs=48000)
        print(f)

        f.normalise()
        unused_BB, AA = f.get_coefficients()
        self.assertAlmostEqual(AA[0], 1.0, places=7)
Exemple #4
0
    def test_get_feed_back(self):
        B = (0.1, 0.2, 0.3)
        A = (0.4, 0.5, 0.6)
        f = linearfilter.Filter(B, A, fs=48000)
        print(f)

        AA = f.get_feed_back()

        self.verify_coefficients(f, B, AA)
Exemple #5
0
    def test_get_feed_forward(self):
        B = (0.1, 0.2, 0.3)
        A = (0.4, 0.5, 0.6)
        f = linearfilter.Filter(B, A, fs=48000)
        print(f)

        BB = f.get_feed_forward()

        self.verify_coefficients(f, BB, A)
Exemple #6
0
 def test_str_method(self):
     f = linearfilter.Filter()
     self.assertIsInstance(f.__str__(), basestring)