Skip to content

Commit

Permalink
Update c6s1_onset_detection.py
Browse files Browse the repository at this point in the history
  • Loading branch information
meinardmueller authored Feb 14, 2024
1 parent f884d4d commit 2a89079
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libfmp/c6/c6s1_onset_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,9 @@ def compute_novelty_complex(x, Fs=1, N=1024, H=64, gamma=10.0, M=40, norm=True):
X_hat = mag * np.exp(2*np.pi*1j*(phase+phase_diff))
X_prime = np.abs(X_hat - X)
X_plus = np.copy(X_prime)
for n in range(1, X.shape[0]):
idx = np.where(mag[n, :] < mag[n-1, :])
X_plus[n, idx] = 0
for n in range(1, X.shape[1]):
idx = np.where(mag[:, n] < mag[:, n-1])
X_plus[idx, n] = 0
novelty_complex = np.sum(X_plus, axis=0)
if M > 0:
local_average = compute_local_average(novelty_complex, M)
Expand Down

0 comments on commit 2a89079

Please sign in to comment.