Skip to content

Commit 929b909

Browse files
committed
Changed back docstring.
1 parent dd644fd commit 929b909

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

repet.py

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
"""
22
This Python module implements a number of functions for the REpeating Pattern Extraction Technique (REPET).
3+
Repetition is a fundamental element in generating and perceiving structure. In audio, mixtures are
4+
often composed of structures where a repeating background signal is superimposed with a varying
5+
foreground signal (e.g., a singer overlaying varying vocals on a repeating accompaniment or a varying
6+
speech signal mixed up with a repeating background noise). On this basis, we present the REpeating
7+
Pattern Extraction Technique (REPET), a simple approach for separating the repeating background from
8+
the non-repeating foreground in an audio mixture. The basic idea is to find the repeating elements in
9+
the mixture, derive the underlying repeating models, and extract the repeating background by comparing
10+
the models to the mixture. Unlike other separation approaches, REPET does not depend on special
11+
parameterizations, does not rely on complex frameworks, and does not require external information.
12+
Because it is only based on repetition, it has the advantage of being simple, fast, blind, and
13+
therefore completely and easily automatable.
314
415
Functions:
516
original - Compute the original REPET.
@@ -19,7 +30,7 @@
1930
http://zafarrafii.com
2031
https://github.com/zafarrafii
2132
https://www.linkedin.com/in/zafarrafii/
22-
01/21/21
33+
01/20/21
2334
"""
2435

2536
import numpy as np
@@ -56,6 +67,8 @@
5667
def original(audio_signal, sampling_frequency):
5768
"""
5869
Compute the original REPET.
70+
The original REPET aims at identifying and extracting the repeating patterns in an audio mixture, by estimating
71+
a period of the underlying repeating structure and modeling a segment of the periodically repeating background.
5972
6073
Inputs:
6174
audio_signal: audio signal (number_samples, number_channels)
@@ -194,6 +207,8 @@ def original(audio_signal, sampling_frequency):
194207
def extended(audio_signal, sampling_frequency):
195208
"""
196209
Compute REPET extended.
210+
The original REPET can be easily extended to handle varying repeating structures, by simply applying the method
211+
along time, on individual segments or via a sliding window.
197212
198213
Inputs:
199214
audio_signal: audio signal (number_samples, number_channels)
@@ -411,6 +426,11 @@ def extended(audio_signal, sampling_frequency):
411426
def adaptive(audio_signal, sampling_frequency):
412427
"""
413428
Compute the adaptive REPET.
429+
The original REPET works well when the repeating background is relatively stable (e.g., a verse or the chorus in
430+
a song); however, the repeating background can also vary over time (e.g., a verse followed by the chorus in the
431+
song). The adaptive REPET is an extension of the original REPET that can handle varying repeating structures, by
432+
estimating the time-varying repeating periods and extracting the repeating background locally, without the need
433+
for segmentation or windowing.
414434
415435
Inputs:
416436
audio_signal: audio signal (number_samples, number_channels)
@@ -557,6 +577,10 @@ def adaptive(audio_signal, sampling_frequency):
557577
def sim(audio_signal, sampling_frequency):
558578
"""
559579
Compute REPET-SIM.
580+
The REPET methods work well when the repeating background has periodically repeating patterns (e.g., jackhammer
581+
noise); however, the repeating patterns can also happen intermittently or without a global or local periodicity
582+
(e.g., frogs by a pond). REPET-SIM is a generalization of REPET that can also handle non-periodically repeating
583+
structures, by using a similarity matrix to identify the repeating elements.
560584
561585
Inputs:
562586
audio_signal: audio signal (number_samples, number_channels)
@@ -696,6 +720,9 @@ def sim(audio_signal, sampling_frequency):
696720
def simonline(audio_signal, sampling_frequency):
697721
"""
698722
Compute the online REPET-SIM.
723+
REPET-SIM can be easily implemented online to handle real-time computing, particularly for real-time speech
724+
enhancement. The online REPET-SIM simply processes the time frames of the mixture one after the other given a
725+
buffer that temporally stores past frames.
699726
700727
Inputs:
701728
audio_signal: audio signal (number_samples, number_channels)

0 commit comments

Comments
 (0)