class_docstr: Mel-Spectrogram using Torchaudio Implementation.
code: def __init__(
      self,
      preemp: bool = True,
      n_fft: int = 512,
      log: bool = False,
      win_length: int = 400,
      hop_length: int = 160,
      f_min: int = 20,
      f_max: int = 7600,
      n_mels: int = 80,
      window_fn: str = "hamming",
      mel_scale: str = "htk",
      normalize: str = None,
  ):
      assert check_argument_types()
      super().__init__()
  
      self.log = log
      self.n_mels = n_mels
      self.preemp = preemp
      self.normalize = normalize
      if window_fn == "hann":
          self.window_fn = torch.hann_window
      elif window_fn == "hamming":
          self.window_fn = torch.hamming_window
  
      if preemp:
          self.register_buffer(
              "flipped_filter",
              torch.FloatTensor([-0.97, 1.0]).unsqueeze(0).unsqueeze(0),
          )
  
      self.transform = ta.transforms.MelSpectrogram(
          n_fft=n_fft,
          win_length=win_length,
          hop_length=hop_length,
          f_min=f_min,
          f_max=f_max,
          n_mels=n_mels,
          window_fn=self.window_fn,
          mel_scale=mel_scale,
      )
  
file_path: espnet/espnet2/asr/frontend/melspec_torch.py
imports: from typing import Tuple
  import torch
  import torch.nn
  import torch.nn.functional
  import torchaudio
  from typeguard import check_argument_types
  from espnet2.asr.frontend.abs_frontend import AbsFrontend
label_desc: Use image node_id 1 to create a new MelSpectrogramTorch object from inherited base classes: AbsFrontend with example: obj = MelSpectrogramTorch(preemp, n_fft, log, win_length, hop_length, f_min, f_max, n_mels, window_fn, mel_scale, normalize)