Пример #1
0
    def check_double(self):
        # Axis -1 
        xt      = xc
        axis    = -1
        order   = 1

        a, e, k = lpc_py(xt, order, axis)
        assert a.dtype == k.dtype == e.dtype == numpy.float64

        tmp     = numpy.zeros((xt.shape[0], order+1), xt.dtype)
        for i in range(xt.shape[0]):
            tmp[i]  = lpc_ref(xt[i], order)

        assert_array_almost_equal(tmp, a)

        # Axis 0
        xt      = xc
        axis    = 0
        order   = 1

        a, e, k = lpc_py(xt, order, axis)
        assert a.dtype == k.dtype == e.dtype == numpy.float64

        tmp     = numpy.zeros((order + 1, xt.shape[1]), xt.dtype)
        for i in range(xt.shape[1]):
            tmp[:, i]   = lpc_ref(xt[:, i], order)

        assert_array_almost_equal(tmp, a)
Пример #2
0
    def check_float(self):
        # Axis -1 
        xt      = xcf
        axis    = -1
        order   = 1

        a, e, k     = lpc2(xt, order, axis)
        at, et, kt  = lpc_py(xt, order, axis)

        assert a.dtype == e.dtype == k.dtype == numpy.float32

        assert_array_almost_equal(a, at)
        assert_array_almost_equal(e, et)
        assert_array_almost_equal(k, kt)

        # Axis 0 
        xt      = xcf
        axis    = 0
        order   = 1

        a, e, k     = lpc2(xt, order, axis)
        at, et, kt  = lpc_py(xt, order, axis)

        assert a.dtype == e.dtype == k.dtype == numpy.float32

        assert_array_almost_equal(a, at)
        assert_array_almost_equal(e, et)
        assert_array_almost_equal(k, kt)
Пример #3
0
    def check_double_rank1(self):
        # test rank 1
        xt      = xc[0]
        axis    = 0
        order   = 1

        a, e, k     = lpc2(xt, order, axis)
        at, et, kt  = lpc_py(xt, order, axis)

        assert_array_almost_equal(a, at)
        assert_array_almost_equal(e, et)
        assert_array_almost_equal(k, kt)
Пример #4
0
    def check_float_rank1(self):
        # test rank 1
        xt      = xcf[0]
        axis    = 0
        order   = 1

        a, e, k     = lpc2(xt, order, axis)
        at, et, kt  = lpc_py(xt, order, axis)

        assert a.dtype == e.dtype == k.dtype == numpy.float32

        assert_array_almost_equal(a, at)
        assert_array_almost_equal(e, et)
        assert_array_almost_equal(k, kt)
Пример #5
0
    def check_double(self):
        # Axis -1 
        xt      = xc
        axis    = -1
        order   = 1

        a, e, k     = lpc2(xt, order, axis)
        at, et, kt  = lpc_py(xt, order, axis)

        assert_array_almost_equal(a, at)
        assert_array_almost_equal(e, et)
        assert_array_almost_equal(k, kt)

        # Axis 0 
        xt      = xc
        axis    = 0
        order   = 1

        a, e, k     = lpc2(xt, order, axis)
        at, et, kt  = lpc_py(xt, order, axis)

        assert_array_almost_equal(a, at)
        assert_array_almost_equal(e, et)
        assert_array_almost_equal(k, kt)