class_docstr: STFT decoder for speech enhancement and separation
class_docstr_tok: ["STFT","decoder","for","speech","enhancement","and","separation"]
code: def __init__(
      self,
      n_fft: int = 512,
      win_length: int = None,
      hop_length: int = 128,
      window="hann",
      center: bool = True,
      normalized: bool = False,
      onesided: bool = True,
      default_fs: int = 16000,
      spec_transform_type: str = None,
      spec_factor: float = 0.15,
      spec_abs_exponent: float = 0.5,
  ):
      super().__init__()
      self.stft = Stft(
          n_fft=n_fft,
          win_length=win_length,
          hop_length=hop_length,
          window=window,
          center=center,
          normalized=normalized,
          onesided=onesided,
      )
  
      self.win_length = win_length if win_length else n_fft
      self.n_fft = n_fft
      self.hop_length = hop_length
      self.window = window
      self.center = center
      self.default_fs = default_fs
  
      # spec transform related. See equation (1) in paper
      # 'Speech Enhancement and Dereverberation With Diffusion-Based Generative
      # Models'. The default value of 0.15, 0.5 also come from the paper.
      # spec_transform_type: "exponent", "log", or "none"
      self.spec_transform_type = spec_transform_type
      # the output specturm will be scaled with: spec * self.spec_factor
      self.spec_factor = spec_factor
      # the exponent factor used in the "exponent" transform
      self.spec_abs_exponent = spec_abs_exponent
  
file_path: espnet/espnet2/enh/decoder/stft_decoder.py
imports: import torch
  import torch_complex
  from packaging.version import parse
  from torch_complex.tensor import ComplexTensor
  from espnet2.enh.decoder.abs_decoder import AbsDecoder
  from espnet2.enh.layers.complex_utils import is_torch_complex_tensor
  from espnet2.layers.stft import Stft
label_desc: Use image node_id 1 to create a new STFTDecoder object from inherited base classes: AbsDecoder with example: obj = STFTDecoder(n_fft, win_length, hop_length, window, center, normalized, onesided, default_fs, spec_transform_type, spec_factor, spec_abs_exponent)