示例#1
0
文件: test_lpc.py 项目: yekm/talkbox
    def test_r2(self):
        """Testing LPC residual of a set of windows."""
        order = 12
        x = np.random.randn(10, 24)

        res = lpcres(x, order)
        r_res = np.empty(x.shape, x.dtype)
        for i in range(10):
            r_res[i] = lfilter(lpc(x[i], order)[0], 1., x[i])

        assert_array_almost_equal(res, r_res)

        res = lpcres(x, order, usefft=False)
        assert_array_almost_equal(res, r_res)
    def test_r2(self):
        """Testing LPC residual of a set of windows."""
        order = 12
        x = np.random.randn(10, 24)

        res = lpcres(x, order)
        r_res = np.empty(x.shape, x.dtype)
        for i in range(10):
            r_res[i] = lfilter(lpc(x[i], order)[0], 1., x[i])

        assert_array_almost_equal(res, r_res)

        res = lpcres(x, order, usefft=False)
        assert_array_almost_equal(res, r_res)
示例#3
0
文件: test_lpc.py 项目: yekm/talkbox
    def test_simple(self):
        """Testing LPC residual of one signal."""
        x = np.linspace(0, 10, 11)
        r_res = np.array([0.,  1.,  1.08531469, 1.23776224, 1.39020979,
                          1.54265734, 1.6951049, 1.84755245, 2., 2.15244755,
                          2.3048951 ])

        res = lpcres(x, 2) 
        assert_array_almost_equal(res, r_res)
    def test_simple(self):
        """Testing LPC residual of one signal."""
        x = np.linspace(0, 10, 11)
        r_res = np.array([0.,  1.,  1.08531469, 1.23776224, 1.39020979,
                          1.54265734, 1.6951049, 1.84755245, 2., 2.15244755,
                          2.3048951 ])

        res = lpcres(x, 2) 
        assert_array_almost_equal(res, r_res)