class_docstr: This class resamples an audio signal using sinc-based interpolation.
  
  It is a modification of the `resample` function from torchaudio
  (https://pytorch.org/audio/stable/tutorials/audio_resampling_tutorial.html)
  
  Arguments
  ---------
  orig_freq : int
      the sampling frequency of the input signal.
  new_freq : int
      the new sampling frequency after this operation is performed.
  lowpass_filter_width : int
      Controls the sharpness of the filter, larger numbers result in a
      sharper filter, but they are less efficient. Values from 4 to 10 are
      allowed.
  
  Example
  -------
  >>> from speechbrain.dataio.dataio import read_audio
  >>> signal = read_audio('tests/samples/single-mic/example1.wav')
  >>> signal = signal.unsqueeze(0) # [batch, time, channels]
  >>> resampler = Resample(orig_freq=16000, new_freq=8000)
  >>> resampled = resampler(signal)
  >>> signal.shape
  torch.Size([1, 52173])
  >>> resampled.shape
  torch.Size([1, 26087])
class_docstr_tok: ["This","class","resamples","an","audio","signal","using","sinc-based","interpolation",".","It","is","a","modification","of","the","`","resample","`","function","from","torchaudio","(","https",":","\/\/pytorch.org\/audio\/stable\/tutorials\/audio_resampling_tutorial.html",")","Arguments","--","--","--","--","-","orig_freq",":","int","the","sampling","frequency","of","the","input","signal",".","new_freq",":","int","the","new","sampling","frequency","after","this","operation","is","performed",".","lowpass_filter_width",":","int","Controls","the","sharpness","of","the","filter",",","larger","numbers","result","in","a","sharper","filter",",","but","they","are","less","efficient",".","Values","from","4","to","10","are","allowed",".","Example","--","--","--","-",">",">",">","from","speechbrain.dataio.dataio","import","read_audio",">",">",">","signal","=","read_audio","(","'tests\/samples\/single-mic\/example1.wav","'",")",">",">",">","signal","=","signal.unsqueeze","(","0",")","#","[","batch",",","time",",","channels","]",">",">",">","resampler","=","Resample","(","orig_freq=16000",",","new_freq=8000",")",">",">",">","resampled","=","resampler","(","signal",")",">",">",">","signal.shape","torch.Size","(","[","1",",","52173","]",")",">",">",">","resampled.shape","torch.Size","(","[","1",",","26087","]",")"]
docstr: Compute the phases in polyphase filter.
  
  (almost directly from torchaudio.compliance.kaldi)
docstr_tok: ["Compute","the","phases","in","polyphase","filter",".","(","almost","directly","from","torchaudio.compliance.kaldi",")"]
code: def _compute_strides(self):
      """Compute the phases in polyphase filter.
  
      (almost directly from torchaudio.compliance.kaldi)
      """
  
      # Compute new unit based on ratio of in/out frequencies
      base_freq = math.gcd(self.orig_freq, self.new_freq)
      input_samples_in_unit = self.orig_freq // base_freq
      self.output_samples = self.new_freq // base_freq
  
      # Store the appropriate stride based on the new units
      self.conv_stride = input_samples_in_unit
      self.conv_transpose_stride = self.output_samples
  
imports: import math
  import random
  import torch
  import torch.nn.functional
  from speechbrain.dataio.legacy import ExtendedCSVDataset
  from speechbrain.dataio.dataloader import make_dataloader
  from speechbrain.processing.signal_processing import compute_amplitude, dB_to_amplitude, convolve1d, notch_filter, reverberate
label_desc: Use image node_id 2 for calling the Resample obj's underlying member method code with example usage: obj._compute_strides() without return types