class_docstr: Asteroid Filterbank Frontend.
  
  Provides a Sinc-convolutional-based audio feature extractor. The same
  function can be achieved by using `sliding_winodw frontend +
  sinc preencoder`.
  
  NOTE(jiatong): this function is used in sentence-level classification
  tasks (e.g., spk). Other usages are not fully investigated.
  
  NOTE(jeeweon): this function implements the parameterized analytic
  filterbank layer in M. Pariente, S. Cornell, A. Deleforge and E. Vincent,
  "Filterbank design for end-to-end speech separation," in Proc. ICASSP, 2020
docstr: Initialize.
  
  Args:
      sinc_filters: the filter numbers for sinc.
      sinc_kernel_size: the kernel size for sinc.
      sinc_stride: the sincstride size of the first sinc-conv layer
          where it decides the compression rate (Hz).
      preemph_coef: the coeifficient for preempahsis.
      log_term: the log term to prevent infinity.
code: def __init__(
      self,
      sinc_filters: int = 256,
      sinc_kernel_size: int = 251,
      sinc_stride: int = 16,
      preemph_coef: float = 0.97,
      log_term: float = 1e-6,
  ):
      """Initialize.
  
      Args:
          sinc_filters: the filter numbers for sinc.
          sinc_kernel_size: the kernel size for sinc.
          sinc_stride: the sincstride size of the first sinc-conv layer
              where it decides the compression rate (Hz).
          preemph_coef: the coeifficient for preempahsis.
          log_term: the log term to prevent infinity.
      """
      assert check_argument_types()
      super().__init__()
  
      # kernel for preemphasis
      # In pytorch, the convolution operation uses cross-correlation,
      # so the filter is flipped
      self.register_buffer(
          "flipped_filter",
          torch.FloatTensor([-preemph_coef, 1.0])
          .unsqueeze(0)
          .unsqueeze(0),
      )
  
      self.norm = nn.InstanceNorm1d(1, eps=1e-4, affine=True)
      self.sinc_filters = sinc_filters
      self.conv = Encoder(
          ParamSincFB(
              sinc_filters, sinc_kernel_size, stride=sinc_stride
          )
      )
      self.log_term = log_term
      self.sinc_kernel_size = sinc_kernel_size
      self.sinc_stride = sinc_stride
      self.output_dim = sinc_filters
  
file_path: espnet/espnet2/asr/frontend/asteroid_frontend.py
imports: from typing import Tuple
  import torch
  import torch.nn
  import torch.nn.functional
  from asteroid_filterbanks import Encoder, ParamSincFB
  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 AsteroidFrontend object from inherited base classes: AbsFrontend with example: obj = AsteroidFrontend(sinc_filters, sinc_kernel_size, sinc_stride, preemph_coef, log_term)