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: :: diff --git a/docs/source/functional.rst b/docs/source/functional.rst index a0f3a272cf..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` ~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 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. 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 diff --git a/torchaudio/utils/sox_utils.py b/torchaudio/utils/sox_utils.py index 59090e4b88..3f9ad0b5ec 100644 --- a/torchaudio/utils/sox_utils.py +++ b/torchaudio/utils/sox_utils.py @@ -26,10 +26,11 @@ 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