class_docstr: Conventional frontend structure for ASR.
  
  Stft -> WPE -> MVDR-Beamformer -> Power-spec -> Log-Mel-Fbank
class_docstr_tok: ["Conventional","frontend","structure","for","ASR",".","Stft","-",">","WPE","-",">","MVDR-Beamformer","-",">","Power-spec","-",">","Log-Mel-Fbank"]
code: def __init__(
      self,
      fs: Union[int, str] = 16000,
      n_fft: int = 512,
      win_length: int = None,
      hop_length: int = 128,
      window: Optional[str] = "hann",
      center: bool = True,
      normalized: bool = False,
      onesided: bool = True,
      n_mels: int = 80,
      fmin: int = None,
      fmax: int = None,
      htk: bool = False,
      frontend_conf: Optional[dict] = get_default_kwargs(Frontend),
      apply_stft: bool = True,
  ):
      assert check_argument_types()
      super().__init__()
      if isinstance(fs, str):
          fs = humanfriendly.parse_size(fs)
  
      # Deepcopy (In general, dict shouldn't be used as default arg)
      frontend_conf = copy.deepcopy(frontend_conf)
      self.hop_length = hop_length
  
      if apply_stft:
          self.stft = Stft(
              n_fft=n_fft,
              win_length=win_length,
              hop_length=hop_length,
              center=center,
              window=window,
              normalized=normalized,
              onesided=onesided,
          )
      else:
          self.stft = None
      self.apply_stft = apply_stft
  
      if frontend_conf is not None:
          self.frontend = Frontend(idim=n_fft // 2 + 1, **frontend_conf)
      else:
          self.frontend = None
  
      self.logmel = LogMel(
          fs=fs,
          n_fft=n_fft,
          n_mels=n_mels,
          fmin=fmin,
          fmax=fmax,
          htk=htk,
      )
      self.n_mels = n_mels
      self.frontend_type = "default"
  
file_path: espnet/espnet2/asr/frontend/default.py
imports: import copy
  from typing import Optional, Tuple, Union
  import humanfriendly
  import numpy
  import torch
  from torch_complex.tensor import ComplexTensor
  from typeguard import check_argument_types
  from espnet2.asr.frontend.abs_frontend import AbsFrontend
  from espnet2.layers.log_mel import LogMel
  from espnet2.layers.stft import Stft
  from espnet2.utils.get_default_kwargs import get_default_kwargs
  from espnet.nets.pytorch_backend.frontends.frontend import Frontend
label_desc: Use image node_id 1 to create a new DefaultFrontend object from inherited base classes: AbsFrontend with example: obj = DefaultFrontend(fs, n_fft, win_length, hop_length, window, center, normalized, onesided, n_mels, fmin, fmax, htk, frontend_conf, apply_stft)