"""
t = rec.shape[1]
if pad and not inverse:
// If we don"t assume that the signal loops,
// stack zeros underneath in the recurrence plot.
struct = np.pad(rec, [(0, t), (0, 0)], mode="constant")
else:
struct = rec.copy()
if inverse:
direction = +1
else:
direction = -1
for i in range(1, t):
struct[:, i] = np.roll(struct[:, i], direction * i, axis=-1)
if inverse and pad:
struct = struct[:t]
// Make column-contiguous
return np.ascontiguousarray(struct.T).T
def timelag_filter(function, pad=True, index=0):
"""Filtering in the time-lag domain.