Skip to content

Commit 1437208

Browse files
author
Caroline Chen
committed
Update docs (#1567)
1 parent c64d285 commit 1437208

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

torchaudio/transforms.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ class Spectrogram(torch.nn.Module):
5454
wkwargs (dict or None, optional): Arguments for window function. (Default: ``None``)
5555
center (bool, optional): whether to pad :attr:`waveform` on both sides so
5656
that the :math:`t`-th frame is centered at time :math:`t \times \text{hop\_length}`.
57-
Default: ``True``
57+
(Default: ``True``)
5858
pad_mode (string, optional): controls the padding method used when
59-
:attr:`center` is ``True``. Default: ``"reflect"``
59+
:attr:`center` is ``True``. (Default: ``"reflect"``)
6060
onesided (bool, optional): controls whether to return half of results to
61-
avoid redundancy Default: ``True``
61+
avoid redundancy (Default: ``True``)
6262
return_complex (bool, optional):
6363
Indicates whether the resulting complex-valued Tensor should be represented with
6464
native complex dtype, such as `torch.cfloat` and `torch.cdouble`, or real dtype
@@ -343,7 +343,7 @@ class InverseMelScale(torch.nn.Module):
343343
tolerance_change (float, optional): Difference in losses to stop optimization at. (Default: ``1e-8``)
344344
sgdargs (dict or None, optional): Arguments for the SGD optimizer. (Default: ``None``)
345345
norm (Optional[str]): If 'slaney', divide the triangular mel weights by the width of the mel band
346-
(area normalization). (Default: ``None``)
346+
(area normalization). (Default: ``None``)
347347
mel_scale (str, optional): Scale to use: ``htk`` or ``slaney``. (Default: ``htk``)
348348
"""
349349
__constants__ = ['n_stft', 'n_mels', 'sample_rate', 'f_min', 'f_max', 'max_iter', 'tolerance_loss',
@@ -434,25 +434,28 @@ class MelSpectrogram(torch.nn.Module):
434434
435435
Args:
436436
sample_rate (int, optional): Sample rate of audio signal. (Default: ``16000``)
437+
n_fft (int, optional): Size of FFT, creates ``n_fft // 2 + 1`` bins. (Default: ``400``)
437438
win_length (int or None, optional): Window size. (Default: ``n_fft``)
438439
hop_length (int or None, optional): Length of hop between STFT windows. (Default: ``win_length // 2``)
439-
n_fft (int, optional): Size of FFT, creates ``n_fft // 2 + 1`` bins. (Default: ``400``)
440440
f_min (float, optional): Minimum frequency. (Default: ``0.``)
441441
f_max (float or None, optional): Maximum frequency. (Default: ``None``)
442442
pad (int, optional): Two sided padding of signal. (Default: ``0``)
443443
n_mels (int, optional): Number of mel filterbanks. (Default: ``128``)
444444
window_fn (Callable[..., Tensor], optional): A function to create a window tensor
445445
that is applied/multiplied to each frame/window. (Default: ``torch.hann_window``)
446+
power (float, optional): Exponent for the magnitude spectrogram,
447+
(must be > 0) e.g., 1 for energy, 2 for power, etc. (Default: ``2``)
448+
normalized (bool, optional): Whether to normalize by magnitude after stft. (Default: ``False``)
446449
wkwargs (Dict[..., ...] or None, optional): Arguments for window function. (Default: ``None``)
447450
center (bool, optional): whether to pad :attr:`waveform` on both sides so
448451
that the :math:`t`-th frame is centered at time :math:`t \times \text{hop\_length}`.
449-
Default: ``True``
452+
(Default: ``True``)
450453
pad_mode (string, optional): controls the padding method used when
451-
:attr:`center` is ``True``. Default: ``"reflect"``
454+
:attr:`center` is ``True``. (Default: ``"reflect"``)
452455
onesided (bool, optional): controls whether to return half of results to
453-
avoid redundancy. Default: ``True``
456+
avoid redundancy. (Default: ``True``)
454457
norm (Optional[str]): If 'slaney', divide the triangular mel weights by the width of the mel band
455-
(area normalization). (Default: ``None``)
458+
(area normalization). (Default: ``None``)
456459
mel_scale (str, optional): Scale to use: ``htk`` or ``slaney``. (Default: ``htk``)
457460
458461
Example

0 commit comments

Comments
 (0)