Commit 129a7c1b authored by Ravi Makhija's avatar Ravi Makhija Committed by Facebook GitHub Bot
Browse files

Added example for InverseMelScale transform (#2635)

Summary:
Added example for InverseMelScale transform as mentioned in issue https://github.com/pytorch/audio/issues/1564.

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

Reviewed By: carolineechen

Differential Revision: D38830318

Pulled By: nateanl

fbshipit-source-id: fd26a700d495f6755db0767625aa8577cb89bd83
parent 55ce80b1
......@@ -433,6 +433,13 @@ class InverseMelScale(torch.nn.Module):
norm (str or None, optional): If "slaney", divide the triangular mel weights by the width of the mel band
(area normalization). (Default: ``None``)
mel_scale (str, optional): Scale to use: ``htk`` or ``slaney``. (Default: ``htk``)
Example
>>> waveform, sample_rate = torchaudio.load("test.wav", normalize=True)
>>> mel_spectrogram_transform = transforms.MelSpectrogram(sample_rate, n_fft=1024)
>>> mel_spectrogram = mel_spectrogram_transform(waveform)
>>> inverse_melscale_transform = transforms.InverseMelScale(n_stft=1024 // 2 + 1)
>>> spectrogram = inverse_melscale_transform(mel_spectrogram)
"""
__constants__ = [
"n_stft",
......
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