class_docstr: Parametric multichannel Wiener filter, with an adjustable
  tradeoff between noise reduction and speech distortion.
  It supports automatic reference channel selection based
  on the estimated output SNR.
  
  Args:
      beta: Parameter of the parameteric filter, tradeoff between noise reduction
            and speech distortion (0: MVDR, 1: MWF).
      rank: Rank assumption for the speech covariance matrix.
      postfilter: Optional postfilter. If None, no postfilter is applied.
      ref_channel: Optional, reference channel. If None, it will be estimated automatically.
      ref_hard: If true, estimate a hard (one-hot) reference. If false, a soft reference.
      ref_hard_use_grad: If true, use straight-through gradient when using the hard reference
      ref_subband_weighting: If true, use subband weighting when estimating reference channel
      num_subbands: Optional, used to determine the parameter size for reference estimation
      diag_reg: Optional, diagonal regularization for the multichannel filter
      eps: Small regularization constant to avoid division by zero
  
  References:
      - Souden et al, On Optimal Frequency-Domain Multichannel Linear Filtering for Noise Reduction, 2010
docstr: Apply blind analytic normalization postfilter. Note that this normalization has been
  derived for the GEV beamformer in [1]. More specifically, the BAN postfilter aims to scale GEV
  to satisfy the distortionless constraint and the final analytical expression is derived using
  an assumption on the norm of the transfer function.
  However, this may still be useful in some instances.
  
  Args:
      input: batch with M output channels (B, M, F, T)
      filter: batch of C-input, M-output filters, shape (B, F, C, M)
      psd_n: batch of noise PSDs, shape (B, F, C, C)
  
  Returns:
      Filtere input, shape (B, M, F, T)
  
  References:
      - Warsitz and Haeb-Umbach, Blind Acoustic Beamforming Based on Generalized Eigenvalue Decomposition, 2007
docstr_tok: ["Apply","blind","analytic","normalization","postfilter",".","Note","that","this","normalization","has","been","derived","for","the","GEV","beamformer","in","[","1","]",".","More","specifically",",","the","BAN","postfilter","aims","to","scale","GEV","to","satisfy","the","distortionless","constraint","and","the","final","analytical","expression","is","derived","using","an","assumption","on","the","norm","of","the","transfer","function",".","However",",","this","may","still","be","useful","in","some","instances",".","Args",":","input",":","batch","with","M","output","channels","(","B",",","M",",","F",",","T",")","filter",":","batch","of","C-input",",","M-output","filters",",","shape","(","B",",","F",",","C",",","M",")","psd_n",":","batch","of","noise","PSDs",",","shape","(","B",",","F",",","C",",","C",")","Returns",":","Filtere","input",",","shape","(","B",",","M",",","F",",","T",")","References",":","-","Warsitz","and","Haeb-Umbach",",","Blind","Acoustic","Beamforming","Based","on","Generalized","Eigenvalue","Decomposition",",","2007"]
code: def apply_ban(
      self,
      input: torch.Tensor,
      filter: torch.Tensor,
      psd_n: torch.Tensor,
  ) -> torch.Tensor:
      """Apply blind analytic normalization postfilter. Note that this normalization has been
      derived for the GEV beamformer in [1]. More specifically, the BAN postfilter aims to scale GEV
      to satisfy the distortionless constraint and the final analytical expression is derived using
      an assumption on the norm of the transfer function.
      However, this may still be useful in some instances.
  
      Args:
          input: batch with M output channels (B, M, F, T)
          filter: batch of C-input, M-output filters, shape (B, F, C, M)
          psd_n: batch of noise PSDs, shape (B, F, C, C)
  
      Returns:
          Filtere input, shape (B, M, F, T)
  
      References:
          - Warsitz and Haeb-Umbach, Blind Acoustic Beamforming Based on Generalized Eigenvalue Decomposition, 2007
      """
      # number of input channel, used to normalize the numerator
      num_inputs = filter.size(-2)
      numerator = torch.einsum(
          "bfcm,bfci,bfij,bfjm->bmf",
          filter.conj(),
          psd_n,
          psd_n,
          filter,
      )
      numerator = torch.sqrt(numerator.abs() / num_inputs)
  
      denominator = torch.einsum(
          "bfcm,bfci,bfim->bmf", filter.conj(), psd_n, filter
      )
      denominator = denominator.abs()
  
      # Scalar filter per output channel, frequency and batch
      # shape (B, M, F)
      ban = numerator / (denominator + self.eps)
  
      input = ban[..., None] * input
  
      return input
  
imports: import random
  from typing import Callable, Optional
  import torch
  from nemo.collections.asr.parts.submodules.multi_head_attention import MultiHeadAttention
  from nemo.core.classes import NeuralModule, typecheck
  from nemo.core.neural_types import AudioSignal, FloatType, NeuralType, SpectrogramType
  from nemo.utils import logging
label_desc: Use image node_id 5 for calling the ParametricMultichannelWienerFilter obj's underlying member method code with example usage: obj.apply_ban(input, filter, psd_n) and returns: input