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
====================
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: ::
......
......@@ -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`
~~~~~~~~~~~~~~~~~~~~~~~~~~
......
......@@ -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
......
......@@ -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.
......
......@@ -224,10 +224,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
......
......@@ -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
......
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