code: def rtf_power(
      psd_s: Tensor,
      psd_n: Tensor,
      reference_channel: Union[int, Tensor],
      n_iter: int = 3,
      diagonal_loading: bool = True,
      diag_eps: float = 1e-7,
  ) -> Tensor:
      r"""Estimate the relative transfer function (RTF) or the steering vector by the power method.
  
      .. devices:: CPU CUDA
  
      .. properties:: Autograd TorchScript
  
      Args:
          psd_s (torch.Tensor): The complex-valued power spectral density (PSD) matrix of target speech.
              Tensor with dimensions `(..., freq, channel, channel)`.
          psd_n (torch.Tensor): The complex-valued power spectral density (PSD) matrix of noise.
              Tensor with dimensions `(..., freq, channel, channel)`.
          reference_channel (int or torch.Tensor): Specifies the reference channel.
              If the dtype is ``int``, it represents the reference channel index.
              If the dtype is ``torch.Tensor``, its shape is `(..., channel)`, where the ``channel`` dimension
              is one-hot.
          diagonal_loading (bool, optional): If ``True``, enables applying diagonal loading to ``psd_n``.
              (Default: ``True``)
          diag_eps (float, optional): The coefficient multiplied to the identity matrix for diagonal loading.
              It is only effective when ``diagonal_loading`` is set to ``True``. (Default: ``1e-7``)
  
      Returns:
          torch.Tensor: The estimated complex-valued RTF of target speech.
          Tensor of dimension `(..., freq, channel)`.
      """
      _assert_psd_matrices(psd_s, psd_n)
      if n_iter <= 0:
          raise ValueError(
              "The number of iteration must be greater than 0."
          )
  
      # Apply diagonal loading to psd_n to improve robustness.
      if diagonal_loading:
          psd_n = _tik_reg(psd_n, reg=diag_eps)
      # phi is regarded as the first iteration
      phi = torch.linalg.solve(psd_n, psd_s)  # psd_n.inv() @ psd_s
      if torch.jit.isinstance(reference_channel, int):
          rtf = phi[..., reference_channel]
      elif torch.jit.isinstance(reference_channel, Tensor):
          reference_channel = reference_channel.to(psd_n.dtype)
          rtf = torch.einsum(
              "...c,...c->...",
              [phi, reference_channel[..., None, None, :]],
          )
      else:
          raise TypeError(
              f'Expected "int" or "Tensor" for reference_channel. Found: {type(reference_channel)}.'
          )
      rtf = rtf.unsqueeze(-1)  # (..., freq, channel, 1)
      if n_iter >= 2:
          # The number of iterations in the for loop is `n_iter - 2`
          # because the `phi` above and `torch.matmul(psd_s, rtf)` are regarded as
          # two iterations.
          for _ in range(n_iter - 2):
              rtf = torch.matmul(phi, rtf)
          rtf = torch.matmul(psd_s, rtf)
      else:
          # if there is only one iteration, the rtf is the psd_s[..., referenc_channel]
          # which is psd_n @ phi @ ref_channel
          rtf = torch.matmul(psd_n, rtf)
      return rtf.squeeze(-1)
  
imports: import math
  import tempfile
  import warnings
  from collections.abc import Sequence
  from typing import List, Optional, Tuple, Union
  import torch
  import torchaudio
  from torch import Tensor
  from torchaudio._internal.module_utils import deprecated
  from .filtering import highpass_biquad, treble_biquad
label_desc: Use image node_id 45 for calling a global function with example usage: rtf_power(psd_s, psd_n, reference_channel, n_iter, diagonal_loading, diag_eps) and returns: rtf