class_docstr: computes the Short-Term Fourier Transform (STFT).
  
  This class computes the Short-Term Fourier Transform of an audio signal.
  It supports multi-channel audio inputs (batch, time, channels).
  
  Arguments
  ---------
  sample_rate : int
      Sample rate of the input audio signal (e.g 16000).
  win_length : float
      Length (in ms) of the sliding window used to compute the STFT.
  hop_length : float
      Length (in ms) of the hope of the sliding window used to compute
      the STFT.
  n_fft : int
      Number of fft point of the STFT. It defines the frequency resolution
      (n_fft should be <= than win_len).
  window_fn : function
      A function that takes an integer (number of samples) and outputs a
      tensor to be multiplied with each window before fft.
  normalized_stft : bool
      If True, the function returns the  normalized STFT results,
      i.e., multiplied by win_length^-0.5 (default is False).
  center : bool
      If True (default), the input will be padded on both sides so that the
      t-th frame is centered at time t×hop_length. Otherwise, the t-th frame
      begins at time t×hop_length.
  pad_mode : str
      It can be 'constant','reflect','replicate', 'circular', 'reflect'
      (default). 'constant' pads the input tensor boundaries with a
      constant value. 'reflect' pads the input tensor using the reflection
      of the input boundary. 'replicate' pads the input tensor using
      replication of the input boundary. 'circular' pads using  circular
      replication.
  onesided : True
      If True (default) only returns nfft/2 values. Note that the other
      samples are redundant due to the Fourier transform conjugate symmetry.
  
  Example
  -------
  >>> import torch
  >>> compute_STFT = STFT(
  ...     sample_rate=16000, win_length=25, hop_length=10, n_fft=400
  ... )
  >>> inputs = torch.randn([10, 16000])
  >>> features = compute_STFT(inputs)
  >>> features.shape
  torch.Size([10, 101, 201, 2])
class_docstr_tok: ["computes","the","Short-Term","Fourier","Transform","(","STFT",")",".","This","class","computes","the","Short-Term","Fourier","Transform","of","an","audio","signal",".","It","supports","multi-channel","audio","inputs","(","batch",",","time",",","channels",")",".","Arguments","--","--","--","--","-","sample_rate",":","int","Sample","rate","of","the","input","audio","signal","(","e.g","16000",")",".","win_length",":","float","Length","(","in","ms",")","of","the","sliding","window","used","to","compute","the","STFT",".","hop_length",":","float","Length","(","in","ms",")","of","the","hope","of","the","sliding","window","used","to","compute","the","STFT",".","n_fft",":","int","Number","of","fft","point","of","the","STFT",".","It","defines","the","frequency","resolution","(","n_fft","should","be","<","=","than","win_len",")",".","window_fn",":","function","A","function","that","takes","an","integer","(","number","of","samples",")","and","outputs","a","tensor","to","be","multiplied","with","each","window","before","fft",".","normalized_stft",":","bool","If","True",",","the","function","returns","the","normalized","STFT","results",",","i.e.",",","multiplied","by","win_length^-0.5","(","default","is","False",")",".","center",":","bool","If","True","(","default",")",",","the","input","will","be","padded","on","both","sides","so","that","the","t-th","frame","is","centered","at","time","t\u00d7hop_length",".","Otherwise",",","the","t-th","frame","begins","at","time","t\u00d7hop_length",".","pad_mode",":","str","It","can","be","'constant","'",",","'reflect","'",",","'replicate","'",",","'circular","'",",","'reflect'","(","default",")",".","'constant","'","pads","the","input","tensor","boundaries","with","a","constant","value",".","'reflect","'","pads","the","input","tensor","using","the","reflection","of","the","input","boundary",".","'replicate","'","pads","the","input","tensor","using","replication","of","the","input","boundary",".","'circular","'","pads","using","circular","replication",".","onesided",":","True","If","True","(","default",")","only","returns","nfft\/2","values",".","Note","that","the","other","samples","are","redundant","due","to","the","Fourier","transform","conjugate","symmetry",".","Example","--","--","--","-",">",">",">","import","torch",">",">",">","compute_STFT","=","STFT","(","...","sample_rate=16000",",","win_length=25",",","hop_length=10",",","n_fft=400","...",")",">",">",">","inputs","=","torch.randn","(","[","10",",","16000","]",")",">",">",">","features","=","compute_STFT","(","inputs",")",">",">",">","features.shape","torch.Size","(","[","10",",","101",",","201",",","2","]",")"]
code: def __init__(
      self,
      sample_rate,
      win_length=25,
      hop_length=10,
      n_fft=400,
      window_fn=torch.hamming_window,
      normalized_stft=False,
      center=True,
      pad_mode="constant",
      onesided=True,
  ):
      super().__init__()
      self.sample_rate = sample_rate
      self.win_length = win_length
      self.hop_length = hop_length
      self.n_fft = n_fft
      self.normalized_stft = normalized_stft
      self.center = center
      self.pad_mode = pad_mode
      self.onesided = onesided
  
      # Convert win_length and hop_length from ms to samples
      self.win_length = int(
          round((self.sample_rate / 1000.0) * self.win_length)
      )
      self.hop_length = int(
          round((self.sample_rate / 1000.0) * self.hop_length)
      )
  
      self.window = window_fn(self.win_length)
  
imports: import math
  import torch
  import logging
  from speechbrain.utils.checkpoints import mark_as_saver, mark_as_loader, mark_as_transfer, register_checkpoint_hooks
  from speechbrain.dataio.dataio import length_to_mask
label_desc: Use image node_id 1 to create a new STFT object from inherited base classes: torch.nn with example: obj = STFT(sample_rate, win_length, hop_length, n_fft, window_fn, normalized_stft, center, pad_mode, onesided)