From 6b49014d24c2421ebff8ddf2113d8c774780c902 Mon Sep 17 00:00:00 2001 From: krishnakalyan3 Date: Thu, 12 Nov 2020 18:40:20 +0100 Subject: [PATCH 01/10] add missing modules --- docs/source/functional.rst | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/docs/source/functional.rst b/docs/source/functional.rst index a0f3a272cf..d49c622e68 100644 --- a/docs/source/functional.rst +++ b/docs/source/functional.rst @@ -124,10 +124,10 @@ vad .. autofunction:: spectrogram -:hidden:`amplitude_to_DB` -~~~~~~~~~~~~~~~~~~~~~~~~~ +:hidden:`spectrogram` +~~~~~~~~~~~~~~~~~~~~~ -.. autofunction:: amplitude_to_DB +.. autofunction:: spectrogram :hidden:`create_fb_matrix` ~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -193,3 +193,13 @@ vad ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. autofunction:: sliding_window_cmn + +:hidden:`griffinlim` +~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. autofunction:: griffinlim + +:hidden:`DB_to_amplitude` +~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. autofunction:: DB_to_amplitude From e13971647384bec3b0798b410e13f5829c79f36b Mon Sep 17 00:00:00 2001 From: krishnakalyan3 Date: Thu, 12 Nov 2020 19:02:07 +0100 Subject: [PATCH 02/10] fix broken link - effect explained --- torchaudio/functional/filtering.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/torchaudio/functional/filtering.py b/torchaudio/functional/filtering.py index aa9f95f2e0..55cf05a51f 100644 --- a/torchaudio/functional/filtering.py +++ b/torchaudio/functional/filtering.py @@ -1006,7 +1006,8 @@ def phaser( References: http://sox.sourceforge.net/sox.html - Scott Lehman, Effects Explained, http://harmony-central.com/Effects/effects-explained.html + Scott Lehman, Effects Explained, + https://web.archive.org/web/20051125072557/http://www.harmony-central.com/Effects/effects-explained.html """ actual_shape = waveform.shape device, dtype = waveform.device, waveform.dtype From 677002a54ab96b137dbdb3b9d0ea65cd9f051253 Mon Sep 17 00:00:00 2001 From: krishnakalyan3 Date: Thu, 12 Nov 2020 20:30:31 +0100 Subject: [PATCH 03/10] fix datasetdoc --- docs/source/datasets.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/datasets.rst b/docs/source/datasets.rst index 2ceb93a440..2fbb2c7929 100644 --- a/docs/source/datasets.rst +++ b/docs/source/datasets.rst @@ -2,7 +2,7 @@ torchaudio.datasets ==================== All datasets are subclasses of :class:`torch.utils.data.Dataset` -i.e, they have ``__getitem__`` and ``__len__`` methods implemented. +and have ``__getitem__`` and ``__len__`` methods implemented. Hence, they can all be passed to a :class:`torch.utils.data.DataLoader` which can load multiple samples parallelly using ``torch.multiprocessing`` workers. For example: :: From f4e4a240a1a0532ee5f749f6d0438f05bae4c8fc Mon Sep 17 00:00:00 2001 From: krishnakalyan3 Date: Thu, 12 Nov 2020 20:39:30 +0100 Subject: [PATCH 04/10] render list for set_verbosity --- torchaudio/utils/sox_utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/torchaudio/utils/sox_utils.py b/torchaudio/utils/sox_utils.py index 59090e4b88..076e26661e 100644 --- a/torchaudio/utils/sox_utils.py +++ b/torchaudio/utils/sox_utils.py @@ -26,10 +26,10 @@ def set_verbosity(verbosity: int): Args: verbosity (int): Set verbosity level of libsox. - 1: failure messages - 2: warnings - 3: details of processing - 4-6: increasing levels of debug messages + 1. failure messages + 2. warnings + 3. details of processing + 4-6. increasing levels of debug messages See Also: http://sox.sourceforge.net/sox.html From cb8fcd46b5d2fee98f19eeff1741851dedf584bb Mon Sep 17 00:00:00 2001 From: krishnakalyan3 Date: Fri, 13 Nov 2020 11:09:15 +0100 Subject: [PATCH 05/10] minor mistake --- docs/source/functional.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/source/functional.rst b/docs/source/functional.rst index d49c622e68..60f69d882b 100644 --- a/docs/source/functional.rst +++ b/docs/source/functional.rst @@ -124,10 +124,10 @@ vad .. autofunction:: spectrogram -:hidden:`spectrogram` -~~~~~~~~~~~~~~~~~~~~~ +:hidden:`amplitude_to_DB` +~~~~~~~~~~~~~~~~~~~~~~~~~ -.. autofunction:: spectrogram +.. autofunction:: amplitude_to_DB :hidden:`create_fb_matrix` ~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -198,7 +198,7 @@ vad ~~~~~~~~~~~~~~~~~~~~~~~~~ .. autofunction:: griffinlim - +s :hidden:`DB_to_amplitude` ~~~~~~~~~~~~~~~~~~~~~~~~~ From 962efbfcb6894dca985b4a5acee998ad7b44626c Mon Sep 17 00:00:00 2001 From: krishnakalyan3 Date: Fri, 13 Nov 2020 11:11:37 +0100 Subject: [PATCH 06/10] realign --- docs/source/functional.rst | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/source/functional.rst b/docs/source/functional.rst index 60f69d882b..ebed60de6b 100644 --- a/docs/source/functional.rst +++ b/docs/source/functional.rst @@ -124,11 +124,21 @@ vad .. autofunction:: spectrogram +:hidden:`griffinlim` +~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. autofunction:: griffinlim + :hidden:`amplitude_to_DB` ~~~~~~~~~~~~~~~~~~~~~~~~~ .. autofunction:: amplitude_to_DB +:hidden:`DB_to_amplitude` +~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. autofunction:: DB_to_amplitude + :hidden:`create_fb_matrix` ~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -193,13 +203,3 @@ vad ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. autofunction:: sliding_window_cmn - -:hidden:`griffinlim` -~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. autofunction:: griffinlim -s -:hidden:`DB_to_amplitude` -~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. autofunction:: DB_to_amplitude From 869ed5e4298f3a4e5e64f821b50694122642735c Mon Sep 17 00:00:00 2001 From: krishnakalyan3 Date: Fri, 13 Nov 2020 11:21:01 +0100 Subject: [PATCH 07/10] remove unused init --- torchaudio/sox_effects/sox_effects.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/torchaudio/sox_effects/sox_effects.py b/torchaudio/sox_effects/sox_effects.py index 8b50d19aa7..ce578dcd40 100644 --- a/torchaudio/sox_effects/sox_effects.py +++ b/torchaudio/sox_effects/sox_effects.py @@ -223,10 +223,9 @@ def apply_effects_file( ... super().__init__() ... self.flist = flist ... self.sample_rate = sample_rate - ... self.rng = None ... ... def __getitem__(self, index): - ... speed = self.rng.uniform(0.5, 2.0) + ... speed = 0.5 + 1.5 * torch.rand() ... effects = [ ... ['gain', '-n', '-10'], # apply 10 db attenuation ... ['remix', '-'], # merge all the channels From 905b6f326042dbdbe0cbb757587f3a922934a126 Mon Sep 17 00:00:00 2001 From: krishnakalyan3 Date: Mon, 23 Nov 2020 09:14:34 +0100 Subject: [PATCH 08/10] list not rendered --- torchaudio/utils/sox_utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/torchaudio/utils/sox_utils.py b/torchaudio/utils/sox_utils.py index 076e26661e..336e859ebd 100644 --- a/torchaudio/utils/sox_utils.py +++ b/torchaudio/utils/sox_utils.py @@ -26,10 +26,10 @@ def set_verbosity(verbosity: int): Args: verbosity (int): Set verbosity level of libsox. - 1. failure messages - 2. warnings - 3. details of processing - 4-6. increasing levels of debug messages + * ``1`` failure messages + * ``2`` warnings + * ``3`` details of processing + * ``4``-``6`` increasing levels of debug messages See Also: http://sox.sourceforge.net/sox.html From 3b8f05df6dba99aec59e05c77f0aed15ca04a071 Mon Sep 17 00:00:00 2001 From: krishnakalyan3 Date: Mon, 23 Nov 2020 09:21:44 +0100 Subject: [PATCH 09/10] blank line --- torchaudio/utils/sox_utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/torchaudio/utils/sox_utils.py b/torchaudio/utils/sox_utils.py index 336e859ebd..3f9ad0b5ec 100644 --- a/torchaudio/utils/sox_utils.py +++ b/torchaudio/utils/sox_utils.py @@ -26,6 +26,7 @@ def set_verbosity(verbosity: int): Args: verbosity (int): Set verbosity level of libsox. + * ``1`` failure messages * ``2`` warnings * ``3`` details of processing From 5e2cd7270548671dbce316912382966b9887ae0a Mon Sep 17 00:00:00 2001 From: krishnakalyan3 Date: Mon, 23 Nov 2020 09:32:16 +0100 Subject: [PATCH 10/10] griffinlim reference list fix --- torchaudio/functional/functional.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/torchaudio/functional/functional.py b/torchaudio/functional/functional.py index b967904f2a..76a87c9c45 100644 --- a/torchaudio/functional/functional.py +++ b/torchaudio/functional/functional.py @@ -102,16 +102,14 @@ def griffinlim( r"""Compute waveform from a linear scale magnitude spectrogram using the Griffin-Lim transformation. Implementation ported from `librosa`. - .. [1] McFee, Brian, Colin Raffel, Dawen Liang, Daniel PW Ellis, Matt McVicar, Eric Battenberg, and Oriol Nieto. + * [1] McFee, Brian, Colin Raffel, Dawen Liang, Daniel PW Ellis, Matt McVicar, Eric Battenberg, and Oriol Nieto. "librosa: Audio and music signal analysis in python." In Proceedings of the 14th python in science conference, pp. 18-25. 2015. - - .. [2] Perraudin, N., Balazs, P., & Søndergaard, P. L. + * [2] Perraudin, N., Balazs, P., & Søndergaard, P. L. "A fast Griffin-Lim algorithm," IEEE Workshop on Applications of Signal Processing to Audio and Acoustics (pp. 1-4), Oct. 2013. - - .. [3] D. W. Griffin and J. S. Lim, + * [3] D. W. Griffin and J. S. Lim, "Signal estimation from modified short-time Fourier transform," IEEE Trans. ASSP, vol.32, no.2, pp.236–243, Apr. 1984.