class_docstr: Spectrogram to waveform conversion module.
class_docstr_tok: ["Spectrogram","to","waveform","conversion","module","."]
docstr: Initialize module.
  
  Args:
      fs: Sampling frequency.
      n_fft: The number of FFT points.
      n_shift: Shift size in points.
      n_mels: The number of mel basis.
      win_length: Window length in points.
      window: Window function type.
      f_min: Minimum frequency to analyze.
      f_max: Maximum frequency to analyze.
      griffin_lim_iters: The number of iterations.
docstr_tok: ["Initialize","module",".","Args",":","fs",":","Sampling","frequency",".","n_fft",":","The","number","of","FFT","points",".","n_shift",":","Shift","size","in","points",".","n_mels",":","The","number","of","mel","basis",".","win_length",":","Window","length","in","points",".","window",":","Window","function","type",".","f_min",":","Minimum","frequency","to","analyze",".","f_max",":","Maximum","frequency","to","analyze",".","griffin_lim_iters",":","The","number","of","iterations","."]
code: def __init__(
      self,
      n_fft: int,
      n_shift: int,
      fs: int = None,
      n_mels: int = None,
      win_length: int = None,
      window: Optional[str] = "hann",
      fmin: int = None,
      fmax: int = None,
      griffin_lim_iters: Optional[int] = 8,
  ):
      """Initialize module.
  
      Args:
          fs: Sampling frequency.
          n_fft: The number of FFT points.
          n_shift: Shift size in points.
          n_mels: The number of mel basis.
          win_length: Window length in points.
          window: Window function type.
          f_min: Minimum frequency to analyze.
          f_max: Maximum frequency to analyze.
          griffin_lim_iters: The number of iterations.
  
      """
      assert check_argument_types()
      self.fs = fs
      self.logmel2linear = (
          partial(
              logmel2linear,
              fs=fs,
              n_fft=n_fft,
              n_mels=n_mels,
              fmin=fmin,
              fmax=fmax,
          )
          if n_mels is not None
          else None
      )
      self.griffin_lim = partial(
          griffin_lim,
          n_fft=n_fft,
          n_shift=n_shift,
          win_length=win_length,
          window=window,
          n_iter=griffin_lim_iters,
      )
      self.params = dict(
          n_fft=n_fft,
          n_shift=n_shift,
          win_length=win_length,
          window=window,
          n_iter=griffin_lim_iters,
      )
      if n_mels is not None:
          self.params.update(fs=fs, n_mels=n_mels, fmin=fmin, fmax=fmax)
  
file_path: espnet/espnet2/utils/griffin_lim.py
imports: import logging
  from functools import partial
  from typing import Optional
  import librosa
  import numpy
  import torch
  from packaging.version import parse
  from typeguard import check_argument_types
label_desc: Use image node_id 1 to create a new Spectrogram2Waveform object from inherited base classes: object with example: obj = Spectrogram2Waveform(n_fft, n_shift, fs, n_mels, win_length, window, fmin, fmax, griffin_lim_iters)