SynthCurves.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:SlidingWindowVideoTDA 作者: ctralie 项目源码 文件源码
def smoothCurve(X, Fac):
    NPoints = X.shape[0]
    dim = X.shape[1]
    idx = range(NPoints)
    idxx = np.linspace(0, NPoints, NPoints*Fac)
    Y = np.zeros((NPoints*Fac, dim))
    NPointsOut = 0
    for ii in range(dim):
        Y[:, ii] = interp.spline(idx, X[:, ii], idxx)
        #Smooth with box filter
        y = (0.5/Fac)*np.convolve(Y[:, ii], np.ones(Fac*2), mode='same')
        Y[0:len(y), ii] = y
        NPointsOut = len(y)
    Y = Y[0:NPointsOut-1, :]
    Y = Y[2*Fac:-2*Fac, :]
    return Y
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号