|
1 | 1 | """ |
2 | 2 | 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. |
3 | 14 |
|
4 | 15 | Functions: |
5 | 16 | original - Compute the original REPET. |
|
19 | 30 | http://zafarrafii.com |
20 | 31 | https://github.com/zafarrafii |
21 | 32 | https://www.linkedin.com/in/zafarrafii/ |
22 | | - 01/21/21 |
| 33 | + 01/20/21 |
23 | 34 | """ |
24 | 35 |
|
25 | 36 | import numpy as np |
|
56 | 67 | def original(audio_signal, sampling_frequency): |
57 | 68 | """ |
58 | 69 | 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. |
59 | 72 |
|
60 | 73 | Inputs: |
61 | 74 | audio_signal: audio signal (number_samples, number_channels) |
@@ -194,6 +207,8 @@ def original(audio_signal, sampling_frequency): |
194 | 207 | def extended(audio_signal, sampling_frequency): |
195 | 208 | """ |
196 | 209 | 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. |
197 | 212 |
|
198 | 213 | Inputs: |
199 | 214 | audio_signal: audio signal (number_samples, number_channels) |
@@ -411,6 +426,11 @@ def extended(audio_signal, sampling_frequency): |
411 | 426 | def adaptive(audio_signal, sampling_frequency): |
412 | 427 | """ |
413 | 428 | 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. |
414 | 434 |
|
415 | 435 | Inputs: |
416 | 436 | audio_signal: audio signal (number_samples, number_channels) |
@@ -557,6 +577,10 @@ def adaptive(audio_signal, sampling_frequency): |
557 | 577 | def sim(audio_signal, sampling_frequency): |
558 | 578 | """ |
559 | 579 | 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. |
560 | 584 |
|
561 | 585 | Inputs: |
562 | 586 | audio_signal: audio signal (number_samples, number_channels) |
@@ -696,6 +720,9 @@ def sim(audio_signal, sampling_frequency): |
696 | 720 | def simonline(audio_signal, sampling_frequency): |
697 | 721 | """ |
698 | 722 | 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. |
699 | 726 |
|
700 | 727 | Inputs: |
701 | 728 | audio_signal: audio signal (number_samples, number_channels) |
|
0 commit comments