def uwt_align_h2(X, inverse=False):
"""UWT h2 coefficients aligment.
If inverse = True performs the misalignment
for a correct reconstruction.
"""
J = X.shape[0] / 2
shifts = np.asarray([2 ** j for j in range(J)])
if not inverse:
shifts *= -1
for j in range(J):
X[j] = np.roll(X[j], shifts[j])
X[j + J] = np.roll(X[j + J], shifts[j])
评论列表
文章目录