Skip to content

Commit f8cb320

Browse files
committed
modulo 2pi
1 parent 9d6c16c commit f8cb320

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

neurodsp/rhythm/phase.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def pairwise_phase_consistency(pha0, pha1, return_pairs=True, memory_gb=2, progr
8686
for idx, pair in iterable:
8787

8888
# Absolute angular distance
89-
abs_dist = np.abs(pha0[pair[0]] - pha1[pair[1]]) % np.pi
89+
abs_dist = np.abs(pha0[pair[0]] - pha1[pair[1]]) % (2 * np.pi)
9090

9191
# Pairwise circular distance index (PCDI)
9292
distance = (np.pi - 2 * abs_dist) / np.pi

0 commit comments

Comments
 (0)