fix: sort ts before aligning
This commit is contained in:
@@ -222,7 +222,8 @@ def interp_missing_1(ts):
|
||||
|
||||
def interp_missing(ts_a_o, ts_b_o):
|
||||
"""interpolate missing beats"""
|
||||
ts_a, ts_b = np.array(ts_a_o), np.array(ts_b_o) # deep copy
|
||||
ts_a = np.array(list(sorted(ts_a_o)))
|
||||
ts_b = np.array(list(sorted(ts_b_o))) # sort & deep copy
|
||||
assert len(ts_a) == len(ts_b)
|
||||
ib_th = 0.2 #: sec (inter-beat interval threshold for interpolation)
|
||||
mn_a, mn_b = np.mean(np.diff(ts_a)), np.mean(np.diff(ts_b))
|
||||
|
||||
Reference in New Issue
Block a user