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: Perform delay and sum 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)
  As : tensor
      The steering vector to point in the direction of
      the target source. The tensor must have the format
      (batch, time_step, n_fft/2 + 1, 2, n_mics)
code: def _delaysum(Xs, As):
      """Perform delay and sum 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)
      As : tensor
          The steering vector to point in the direction of
          the target source. The tensor must have the format
          (batch, time_step, n_fft/2 + 1, 2, n_mics)
      """
  
      # Get useful dimensions
      n_mics = Xs.shape[4]
  
      # Generate unmixing coefficients
      Ws_re = As[..., 0, :] / n_mics
      Ws_im = -1 * As[..., 1, :] / n_mics
  
      # Get input signal
      Xs_re = Xs[..., 0, :]
      Xs_im = Xs[..., 1, :]
  
      # Applying delay and sum
      Ys_re = torch.sum(
          (Ws_re * Xs_re - Ws_im * Xs_im), dim=3, keepdim=True
      )
      Ys_im = torch.sum(
          (Ws_re * Xs_im + Ws_im * Xs_re), dim=3, keepdim=True
      )
  
      # Assembling the result
      Ys = torch.stack((Ys_re, Ys_im), 3)
  
      return Ys
  
imports: import torch
  from packaging import version
  import speechbrain.processing.decomposition
label_desc: Use image node_id 3 for calling the DelaySum obj's underlying member method code with example usage: obj._delaysum(Xs, As) and returns: Ys