Unverified Commit 2a02d7f5 authored by Krishna Kalyan's avatar Krishna Kalyan Committed by GitHub
Browse files

[Doc] Add missing modules and minor fixes (#1022)



* Add griffinlim and DB_to_amplitude
* Fix Dataset docstring
* Fix other formatting
Co-authored-by: default avatarkrishnakalyan3 <skalyan@cloudera.com>
parent 09a6fca1
...@@ -2,7 +2,7 @@ torchaudio.datasets ...@@ -2,7 +2,7 @@ torchaudio.datasets
==================== ====================
All datasets are subclasses of :class:`torch.utils.data.Dataset` 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` Hence, they can all be passed to a :class:`torch.utils.data.DataLoader`
which can load multiple samples parallelly using ``torch.multiprocessing`` workers. which can load multiple samples parallelly using ``torch.multiprocessing`` workers.
For example: :: For example: ::
......
...@@ -124,11 +124,21 @@ vad ...@@ -124,11 +124,21 @@ vad
.. autofunction:: spectrogram .. autofunction:: spectrogram
:hidden:`griffinlim`
~~~~~~~~~~~~~~~~~~~~~~~~~
.. autofunction:: griffinlim
:hidden:`amplitude_to_DB` :hidden:`amplitude_to_DB`
~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~
.. autofunction:: amplitude_to_DB .. autofunction:: amplitude_to_DB
:hidden:`DB_to_amplitude`
~~~~~~~~~~~~~~~~~~~~~~~~~
.. autofunction:: DB_to_amplitude
:hidden:`create_fb_matrix` :hidden:`create_fb_matrix`
~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~
......
...@@ -1006,7 +1006,8 @@ def phaser( ...@@ -1006,7 +1006,8 @@ def phaser(
References: References:
http://sox.sourceforge.net/sox.html 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 actual_shape = waveform.shape
device, dtype = waveform.device, waveform.dtype device, dtype = waveform.device, waveform.dtype
......
...@@ -102,16 +102,14 @@ def griffinlim( ...@@ -102,16 +102,14 @@ def griffinlim(
r"""Compute waveform from a linear scale magnitude spectrogram using the Griffin-Lim transformation. r"""Compute waveform from a linear scale magnitude spectrogram using the Griffin-Lim transformation.
Implementation ported from `librosa`. 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." "librosa: Audio and music signal analysis in python."
In Proceedings of the 14th python in science conference, pp. 18-25. 2015. 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," "A fast Griffin-Lim algorithm,"
IEEE Workshop on Applications of Signal Processing to Audio and Acoustics (pp. 1-4), IEEE Workshop on Applications of Signal Processing to Audio and Acoustics (pp. 1-4),
Oct. 2013. 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," "Signal estimation from modified short-time Fourier transform,"
IEEE Trans. ASSP, vol.32, no.2, pp.236–243, Apr. 1984. IEEE Trans. ASSP, vol.32, no.2, pp.236–243, Apr. 1984.
......
...@@ -224,10 +224,9 @@ def apply_effects_file( ...@@ -224,10 +224,9 @@ def apply_effects_file(
... super().__init__() ... super().__init__()
... self.flist = flist ... self.flist = flist
... self.sample_rate = sample_rate ... self.sample_rate = sample_rate
... self.rng = None
... ...
... def __getitem__(self, index): ... def __getitem__(self, index):
... speed = self.rng.uniform(0.5, 2.0) ... speed = 0.5 + 1.5 * torch.rand()
... effects = [ ... effects = [
... ['gain', '-n', '-10'], # apply 10 db attenuation ... ['gain', '-n', '-10'], # apply 10 db attenuation
... ['remix', '-'], # merge all the channels ... ['remix', '-'], # merge all the channels
......
...@@ -26,10 +26,11 @@ def set_verbosity(verbosity: int): ...@@ -26,10 +26,11 @@ def set_verbosity(verbosity: int):
Args: Args:
verbosity (int): Set verbosity level of libsox. verbosity (int): Set verbosity level of libsox.
1: failure messages
2: warnings * ``1`` failure messages
3: details of processing * ``2`` warnings
4-6: increasing levels of debug messages * ``3`` details of processing
* ``4``-``6`` increasing levels of debug messages
See Also: See Also:
http://sox.sourceforge.net/sox.html http://sox.sourceforge.net/sox.html
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment