Commit 85cb37e2 authored by cai525's avatar cai525 Committed by Facebook GitHub Bot
Browse files

Fix documentation of functional and transforms (#3134)

Summary:
Address #3101. The documentation for `power=1` should represent magnitude instead of energy.

Pull Request resolved: https://github.com/pytorch/audio/pull/3134

Reviewed By: mthrok

Differential Revision: D43910652

Pulled By: nateanl

fbshipit-source-id: e0768438e819222a5dde6b86c5123ab0e8af59fb
parent 146195d8
...@@ -83,7 +83,7 @@ def spectrogram( ...@@ -83,7 +83,7 @@ def spectrogram(
hop_length (int): Length of hop between STFT windows hop_length (int): Length of hop between STFT windows
win_length (int): Window size win_length (int): Window size
power (float or None): Exponent for the magnitude spectrogram, power (float or None): Exponent for the magnitude spectrogram,
(must be > 0) e.g., 1 for energy, 2 for power, etc. (must be > 0) e.g., 1 for magnitude, 2 for power, etc.
If None, then the complex spectrum is returned instead. If None, then the complex spectrum is returned instead.
normalized (bool or str): Whether to normalize by magnitude after stft. If input is str, choices are normalized (bool or str): Whether to normalize by magnitude after stft. If input is str, choices are
``"window"`` and ``"frame_length"``, if specific normalization type is desirable. ``True`` maps to ``"window"`` and ``"frame_length"``, if specific normalization type is desirable. ``True`` maps to
...@@ -286,7 +286,7 @@ def griffinlim( ...@@ -286,7 +286,7 @@ def griffinlim(
Default: ``win_length // 2``) Default: ``win_length // 2``)
win_length (int): Window size. (Default: ``n_fft``) win_length (int): Window size. (Default: ``n_fft``)
power (float): Exponent for the magnitude spectrogram, power (float): Exponent for the magnitude spectrogram,
(must be > 0) e.g., 1 for energy, 2 for power, etc. (must be > 0) e.g., 1 for magnitude, 2 for power, etc.
n_iter (int): Number of iteration for phase recovery process. n_iter (int): Number of iteration for phase recovery process.
momentum (float): The momentum parameter for fast Griffin-Lim. momentum (float): The momentum parameter for fast Griffin-Lim.
Setting this to 0 recovers the original Griffin-Lim method. Setting this to 0 recovers the original Griffin-Lim method.
......
...@@ -36,7 +36,7 @@ class Spectrogram(torch.nn.Module): ...@@ -36,7 +36,7 @@ class Spectrogram(torch.nn.Module):
window_fn (Callable[..., Tensor], optional): A function to create a window tensor window_fn (Callable[..., Tensor], optional): A function to create a window tensor
that is applied/multiplied to each frame/window. (Default: ``torch.hann_window``) that is applied/multiplied to each frame/window. (Default: ``torch.hann_window``)
power (float or None, optional): Exponent for the magnitude spectrogram, power (float or None, optional): Exponent for the magnitude spectrogram,
(must be > 0) e.g., 1 for energy, 2 for power, etc. (must be > 0) e.g., 1 for magnitude, 2 for power, etc.
If None, then the complex spectrum is returned instead. (Default: ``2``) If None, then the complex spectrum is returned instead. (Default: ``2``)
normalized (bool or str, optional): Whether to normalize by magnitude after stft. If input is str, choices are normalized (bool or str, optional): Whether to normalize by magnitude after stft. If input is str, choices are
``"window"`` and ``"frame_length"``, if specific normalization type is desirable. ``True`` maps to ``"window"`` and ``"frame_length"``, if specific normalization type is desirable. ``True`` maps to
...@@ -227,7 +227,7 @@ class GriffinLim(torch.nn.Module): ...@@ -227,7 +227,7 @@ class GriffinLim(torch.nn.Module):
window_fn (Callable[..., Tensor], optional): A function to create a window tensor window_fn (Callable[..., Tensor], optional): A function to create a window tensor
that is applied/multiplied to each frame/window. (Default: ``torch.hann_window``) that is applied/multiplied to each frame/window. (Default: ``torch.hann_window``)
power (float, optional): Exponent for the magnitude spectrogram, power (float, optional): Exponent for the magnitude spectrogram,
(must be > 0) e.g., 1 for energy, 2 for power, etc. (Default: ``2``) (must be > 0) e.g., 1 for magnitude, 2 for power, etc. (Default: ``2``)
wkwargs (dict or None, optional): Arguments for window function. (Default: ``None``) wkwargs (dict or None, optional): Arguments for window function. (Default: ``None``)
momentum (float, optional): The momentum parameter for fast Griffin-Lim. momentum (float, optional): The momentum parameter for fast Griffin-Lim.
Setting this to 0 recovers the original Griffin-Lim method. Setting this to 0 recovers the original Griffin-Lim method.
...@@ -560,7 +560,7 @@ class MelSpectrogram(torch.nn.Module): ...@@ -560,7 +560,7 @@ class MelSpectrogram(torch.nn.Module):
window_fn (Callable[..., Tensor], optional): A function to create a window tensor window_fn (Callable[..., Tensor], optional): A function to create a window tensor
that is applied/multiplied to each frame/window. (Default: ``torch.hann_window``) that is applied/multiplied to each frame/window. (Default: ``torch.hann_window``)
power (float, optional): Exponent for the magnitude spectrogram, power (float, optional): Exponent for the magnitude spectrogram,
(must be > 0) e.g., 1 for energy, 2 for power, etc. (Default: ``2``) (must be > 0) e.g., 1 for magnitude, 2 for power, etc. (Default: ``2``)
normalized (bool, optional): Whether to normalize by magnitude after stft. (Default: ``False``) normalized (bool, optional): Whether to normalize by magnitude after stft. (Default: ``False``)
wkwargs (Dict[..., ...] or None, optional): Arguments for window function. (Default: ``None``) wkwargs (Dict[..., ...] or None, optional): Arguments for window function. (Default: ``None``)
center (bool, optional): whether to pad :attr:`waveform` on both sides so center (bool, optional): whether to pad :attr:`waveform` on both sides so
......
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