Skip to content

Commit 592e5e8

Browse files
committed
Little update.
1 parent f746807 commit 592e5e8

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

examples.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
"background_signal = repet.original(audio_signal, sampling_frequency)\n",
101101
"foreground_signal = audio_signal-background_signal\n",
102102
"\n",
103-
"Write the background and foreground signals\n",
103+
"# Write the background and foreground signals\n",
104104
"repet.wavwrite(background_signal, sampling_frequency, \"background_signal.wav\")\n",
105105
"repet.wavwrite(foreground_signal, sampling_frequency, \"foreground_signal.wav\")\n",
106106
"\n",

repet.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
http://zafarrafii.com
3131
https://github.com/zafarrafii
3232
https://www.linkedin.com/in/zafarrafii/
33-
01/22/21
33+
01/23/21
3434
"""
3535

3636
import numpy as np
@@ -1262,7 +1262,7 @@ def _periods(beat_spectrogram, period_range):
12621262
Compute the repeating period(s) from the beat spectrogram(spectrum) given a period range.
12631263
12641264
Input:
1265-
beat_spectrogram: beat spectrogram (or spectrum) (number_frequencies, number_lags) (or (number_lags, ))
1265+
beat_spectrogram: beat spectrogram (or spectrum) (number_lags, number_times) (or (number_lags, ))
12661266
Output:
12671267
repeating_periods: repeating period(s) in lags (number_periods,) (or scalar)
12681268
"""
@@ -1281,7 +1281,7 @@ def _periods(beat_spectrogram, period_range):
12811281
+ 1
12821282
)
12831283

1284-
# Else, compute the repeating periods as the argmax of the frequency channels given the period range
1284+
# Else, compute the repeating periods as the argmax for all the time frames given the period range
12851285
else:
12861286
repeating_periods = (
12871287
np.argmax(
@@ -1409,15 +1409,15 @@ def _mask(audio_spectrogram, repeating_period):
14091409
# Estimate the number of segments (including the last partial one)
14101410
number_segments = int(np.ceil(number_times / repeating_period))
14111411

1412-
# Zero-pad the end of the spectrogram to have a full last segment
1412+
# Pad the end of the spectrogram to have a full last segment
14131413
audio_spectrogram = np.pad(
14141414
audio_spectrogram,
14151415
((0, 0), (0, number_segments * repeating_period - number_times)),
14161416
"constant",
14171417
constant_values=0,
14181418
)
14191419

1420-
# Reshape the zero-padded spectrogram to a tensor of size (number_frequencies, number_times, number_segments)
1420+
# Reshape the padded spectrogram to a tensor of size (number_frequencies, number_times, number_segments)
14211421
audio_spectrogram = np.reshape(
14221422
audio_spectrogram,
14231423
(number_frequencies, repeating_period, number_segments),

0 commit comments

Comments
 (0)