class_docstr: Performs delay and sum beamforming by using the TDOAs and
  the first channel as a reference.
  
  Example
  -------
  >>> import torch
  
  >>> from speechbrain.dataio.dataio import read_audio
  >>> from speechbrain.processing.features import STFT, ISTFT
  >>> from speechbrain.processing.multi_mic import Covariance
  >>> from speechbrain.processing.multi_mic import GccPhat, DelaySum
  >>>
  >>> xs_speech = read_audio(
  ...    'tests/samples/multi-mic/speech_-0.82918_0.55279_-0.082918.flac'
  ... )
  >>> xs_speech = xs_speech. unsqueeze(0) # [batch, time, channel]
  >>> xs_noise  = read_audio('tests/samples/multi-mic/noise_diffuse.flac')
  >>> xs_noise = xs_noise.unsqueeze(0) #[batch, time, channels]
  >>> fs = 16000
  >>> xs = xs_speech + 0.05 * xs_noise
  >>>
  >>> stft = STFT(sample_rate=fs)
  >>> cov = Covariance()
  >>> gccphat = GccPhat()
  >>> delaysum = DelaySum()
  >>> istft = ISTFT(sample_rate=fs)
  >>>
  >>> Xs = stft(xs)
  >>> XXs = cov(Xs)
  >>> tdoas = gccphat(XXs)
  >>> Ys = delaysum(Xs, tdoas)
  >>> ys = istft(Ys)
class_docstr_tok: ["Performs","delay","and","sum","beamforming","by","using","the","TDOAs","and","the","first","channel","as","a","reference",".","Example","--","--","--","-",">",">",">","import","torch",">",">",">","from","speechbrain.dataio.dataio","import","read_audio",">",">",">","from","speechbrain.processing.features","import","STFT",",","ISTFT",">",">",">","from","speechbrain.processing.multi_mic","import","Covariance",">",">",">","from","speechbrain.processing.multi_mic","import","GccPhat",",","DelaySum",">",">",">",">",">",">","xs_speech","=","read_audio","(","...","'tests\/samples\/multi-mic\/speech_-0.82918_0.55279_-0.082918.flac'","...",")",">",">",">","xs_speech","=","xs_speech",".","unsqueeze","(","0",")","#","[","batch",",","time",",","channel","]",">",">",">","xs_noise","=","read_audio","(","'tests\/samples\/multi-mic\/noise_diffuse.flac","'",")",">",">",">","xs_noise","=","xs_noise.unsqueeze","(","0",")","#","[","batch",",","time",",","channels","]",">",">",">","fs","=","16000",">",">",">","xs","=","xs_speech","+","0.05","*","xs_noise",">",">",">",">",">",">","stft","=","STFT","(","sample_rate=fs",")",">",">",">","cov","=","Covariance","(",")",">",">",">","gccphat","=","GccPhat","(",")",">",">",">","delaysum","=","DelaySum","(",")",">",">",">","istft","=","ISTFT","(","sample_rate=fs",")",">",">",">",">",">",">","Xs","=","stft","(","xs",")",">",">",">","XXs","=","cov","(","Xs",")",">",">",">","tdoas","=","gccphat","(","XXs",")",">",">",">","Ys","=","delaysum","(","Xs",",","tdoas",")",">",">",">","ys","=","istft","(","Ys",")"]
docstr: This method computes a steering vector by using the TDOAs/DOAs and
  then calls the utility function _delaysum to perform beamforming.
  The result has the following format: (batch, time_step, n_fft, 2, 1).
  
  Arguments
  ---------
  Xs : tensor
      A batch of audio signals in the frequency domain.
      The tensor must have the following format:
      (batch, time_step, n_fft/2 + 1, 2, n_mics)
  localization_tensor : tensor
      A tensor containing either time differences of arrival (TDOAs)
      (in samples) for each timestamp or directions of arrival (DOAs)
      (xyz coordinates in meters). If localization_tensor represents
      TDOAs, then its format is (batch, time_steps, n_mics + n_pairs).
      If localization_tensor represents DOAs, then its format is
      (batch, time_steps, 3)
  doa_mode : bool
      The user needs to set this parameter to True if localization_tensor
      represents DOAs instead of TDOAs. Its default value is set to False.
  mics : tensor
      The cartesian position (xyz coordinates in meters) of each microphone.
      The tensor must have the following format (n_mics, 3). This
      parameter is only mandatory when localization_tensor represents
      DOAs.
  fs : int
      The sample rate in Hertz of the signals. This parameter is only
      mandatory when localization_tensor represents DOAs.
  c : float
      The speed of sound in the medium. The speed is expressed in meters
      per second and the default value of this parameter is 343 m/s. This
      parameter is only used when localization_tensor represents DOAs.
code: def forward(
      self,
      Xs,
      localization_tensor,
      doa_mode=False,
      mics=None,
      fs=None,
      c=343.0,
  ):
      """This method computes a steering vector by using the TDOAs/DOAs and
      then calls the utility function _delaysum to perform beamforming.
      The result has the following format: (batch, time_step, n_fft, 2, 1).
  
      Arguments
      ---------
      Xs : tensor
          A batch of audio signals in the frequency domain.
          The tensor must have the following format:
          (batch, time_step, n_fft/2 + 1, 2, n_mics)
      localization_tensor : tensor
          A tensor containing either time differences of arrival (TDOAs)
          (in samples) for each timestamp or directions of arrival (DOAs)
          (xyz coordinates in meters). If localization_tensor represents
          TDOAs, then its format is (batch, time_steps, n_mics + n_pairs).
          If localization_tensor represents DOAs, then its format is
          (batch, time_steps, 3)
      doa_mode : bool
          The user needs to set this parameter to True if localization_tensor
          represents DOAs instead of TDOAs. Its default value is set to False.
      mics : tensor
          The cartesian position (xyz coordinates in meters) of each microphone.
          The tensor must have the following format (n_mics, 3). This
          parameter is only mandatory when localization_tensor represents
          DOAs.
      fs : int
          The sample rate in Hertz of the signals. This parameter is only
          mandatory when localization_tensor represents DOAs.
      c : float
          The speed of sound in the medium. The speed is expressed in meters
          per second and the default value of this parameter is 343 m/s. This
          parameter is only used when localization_tensor represents DOAs.
      """
  
      # Get useful dimensions
      n_fft = Xs.shape[2]
      localization_tensor = localization_tensor.to(Xs.device)
      # Convert the tdoas to taus
      if doa_mode:
          taus = doas2taus(
              doas=localization_tensor, mics=mics, fs=fs, c=c
          )
  
      else:
          taus = tdoas2taus(tdoas=localization_tensor)
  
      # Generate the steering vector
      As = steering(taus=taus, n_fft=n_fft)
  
      # Apply delay and sum
      Ys = DelaySum._delaysum(Xs=Xs, As=As)
  
      return Ys
  
imports: import torch
  from packaging import version
  import speechbrain.processing.decomposition
label_desc: Use image node_id 2 for calling the DelaySum obj's underlying member method code with example usage: obj.forward(Xs, localization_tensor, doa_mode, mics, fs, c) and returns: Ys