Ejemplo n.º 1
0
    def testEmpty(self):
        gen = VectorInput([])
        leq = sLeq()
        p = Pool()

        gen.data >> leq.signal
        leq.leq >> (p, 'leq')

        run(gen)

        self.assertEqual(len(p.descriptorNames()), 0)
Ejemplo n.º 2
0
    def testEmpty(self):
        gen = VectorInput([])
        leq = sLeq()
        p = Pool()

        gen.data >> leq.signal
        leq.leq >> (p, 'leq')

        run(gen)

        self.assertEqual(len(p.descriptorNames()), 0)
Ejemplo n.º 3
0
    def testRegression(self):
        input = [1. / (i+1) * sin(2*pi*440*i/44100) for i in range(22050)]
        input += [0]*22050

        gen = VectorInput(input)
        leq = sLeq()
        p = Pool()

        gen.data >> leq.signal
        leq.leq >> (p, 'leq')

        run(gen)

        self.assertAlmostEqual(p['leq'], Leq()(input), 5e-5)
Ejemplo n.º 4
0
    def testRegression(self):
        input = [
            1. / (i + 1) * sin(2 * pi * 440 * i / 44100) for i in range(22050)
        ]
        input += [0] * 22050

        gen = VectorInput(input)
        leq = sLeq()
        p = Pool()

        gen.data >> leq.signal
        leq.leq >> (p, 'leq')

        run(gen)

        self.assertAlmostEqual(p['leq'], Leq()(input), 5e-5)