class_docstr: Some of the audio processing funtions using Torch for faster batch processing.
  
  Args:
  
      n_fft (int):
          FFT window size for STFT.
  
      hop_length (int):
          number of frames between STFT columns.
  
      win_length (int, optional):
          STFT window length.
  
      pad_wav (bool, optional):
          If True pad the audio with (n_fft - hop_length) / 2). Defaults to False.
  
      window (str, optional):
          The name of a function to create a window tensor that is applied/multiplied to each frame/window. Defaults to "hann_window"
  
      sample_rate (int, optional):
          target audio sampling rate. Defaults to None.
  
      mel_fmin (int, optional):
          minimum filter frequency for computing melspectrograms. Defaults to None.
  
      mel_fmax (int, optional):
          maximum filter frequency for computing melspectrograms. Defaults to None.
  
      n_mels (int, optional):
          number of melspectrogram dimensions. Defaults to None.
  
      use_mel (bool, optional):
          If True compute the melspectrograms otherwise. Defaults to False.
  
      do_amp_to_db_linear (bool, optional):
          enable/disable amplitude to dB conversion of linear spectrograms. Defaults to False.
  
      spec_gain (float, optional):
          gain applied when converting amplitude to DB. Defaults to 1.0.
  
      power (float, optional):
          Exponent for the magnitude spectrogram, e.g., 1 for energy, 2 for power, etc.  Defaults to None.
  
      use_htk (bool, optional):
          Use HTK formula in mel filter instead of Slaney.
  
      mel_norm (None, 'slaney', or number, optional):
          If 'slaney', divide the triangular mel weights by the width of the mel band
          (area normalization).
  
          If numeric, use `librosa.util.normalize` to normalize each filter by to unit l_p norm.
          See `librosa.util.normalize` for a full description of supported norm values
          (including `+-np.inf`).
  
          Otherwise, leave all the triangles aiming for a peak value of 1.0. Defaults to "slaney".
docstr: Compute spectrogram frames by torch based stft.
  
  Args:
      x (Tensor): input waveform
  
  Returns:
      Tensor: spectrogram frames.
  
  Shapes:
      x: [B x T] or [:math:`[B, 1, T]`]
code: def __call__(self, x):
      """Compute spectrogram frames by torch based stft.
  
      Args:
          x (Tensor): input waveform
  
      Returns:
          Tensor: spectrogram frames.
  
      Shapes:
          x: [B x T] or [:math:`[B, 1, T]`]
      """
      if x.ndim == 2:
          x = x.unsqueeze(1)
      if self.pad_wav:
          padding = int((self.n_fft - self.hop_length) / 2)
          x = torch.nn.functional.pad(
              x, (padding, padding), mode="reflect"
          )
      # B x D x T x 2
      o = torch.stft(
          x.squeeze(1),
          self.n_fft,
          self.hop_length,
          self.win_length,
          self.window,
          center=True,
          pad_mode="reflect",  # compatible with audio.py
          normalized=self.normalized,
          onesided=True,
          return_complex=False,
      )
      M = o[:, :, :, 0]
      P = o[:, :, :, 1]
      S = torch.sqrt(torch.clamp(M**2 + P**2, min=1e-8))
  
      if self.power is not None:
          S = S**self.power
  
      if self.use_mel:
          S = torch.matmul(self.mel_basis.to(x), S)
      if self.do_amp_to_db:
          S = self._amp_to_db(S, spec_gain=self.spec_gain)
      return S
  
file_path: TTS/TTS/utils/audio/torch_transforms.py
imports: import librosa
  import torch
  from torch import nn
label_desc: Use image node_id 2 for calling the TorchSTFT obj's underlying member method code with example usage: obj.__call__(x) and returns: S