Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broaden the search range #55

Merged
merged 4 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions audio_offset_finder/audio_offset_finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def find_offset_between_buffers(buffer1, buffer2, fs, hop_length=128, win_length
}


# returns an array in which the first half represents an offset of mfcc2 within mfcc2,
# returns an array in which the first half represents an offset of mfcc2 within mfcc1,
# and the second half (accessed by negative indices) vice-versa.
def cross_correlation(mfcc1, mfcc2, nframes):
"""Calculate the cross-correlation curve between two numpy arrays (assumed to be MFCCs).
Expand All @@ -186,8 +186,8 @@ def cross_correlation(mfcc1, mfcc2, nframes):
"""
n1, mdim1 = mfcc1.shape
n2, mdim2 = mfcc2.shape
o_min = nframes - min(n1, n2)
o_max = min(n1, n2) - nframes + 1
o_min = nframes - n2
o_max = n1 - nframes + 1
n = o_max - o_min
c = np.zeros(n)
for k in range(o_min, 0):
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
librosa==0.10.2
matplotlib==3.7.3
numpy==1.22.0
numpy==1.22.3
pytest==6.2.5
scipy==1.10.0
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ packages = find:
install_requires =
librosa >= 0.10.2
matplotlib >= 3.7.3
numpy >= 1.22.0
numpy >= 1.22.3,<2
scipy >= 1.10.0

[options.extras_require]
Expand Down
Loading