diff --git a/torchaudio/transforms.py b/torchaudio/transforms.py index 4d9ae9d736..c80a250b6e 100644 --- a/torchaudio/transforms.py +++ b/torchaudio/transforms.py @@ -67,6 +67,12 @@ class Spectrogram(torch.nn.Module): This argument is only effective when ``power=None``. It is ignored for cases where ``power`` is a number as in those cases, the returned tensor is power spectrogram, which is a real-valued tensor. + + Example + >>> waveform, sample_rate = torchaudio.load('test.wav', normalize=True) + >>> transform = torchaudio.transforms.Spectrogram(n_fft=800) + >>> spectrogram = transform(waveform) + """ __constants__ = ['n_fft', 'win_length', 'hop_length', 'pad', 'power', 'normalized']