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