快捷方式

RTFMVDR

class torchaudio.transforms.RTFMVDR(*args, **kwargs)[原始碼]

基於相對傳遞函式 (RTF) 和噪聲功率譜密度 (PSD) 矩陣的最小方差無畸變響應 (MVDR [Capon, 1969]) 模組。

This feature supports the following devices: CPU, CUDA This API supports the following properties: Autograd, TorchScript

給定多通道復值頻譜 \(\textbf{Y}\)、目標語音的相對傳遞函式 (RTF) 矩陣或導向向量 \(\bm{v}\)、噪聲的 PSD 矩陣 \(\bf{\Phi}_{\textbf{NN}}\) 以及表示參考通道的 one-hot 向量 \(\bf{u}\),該模組計算增強語音的單通道復值頻譜 \(\hat{\textbf{S}}\)。公式定義為

\[\hat{\textbf{S}}(f) = \textbf{w}_{\text{bf}}(f)^{\mathsf{H}} \textbf{Y}(f) \]

其中 \(\textbf{w}_{\text{bf}}(f)\) 是第 \(f\) 個頻率 bin 的 MVDR 波束賦形權重,\((.)^{\mathsf{H}}\) 表示 Hermitian 共軛運算。

波束賦形權重透過以下公式計算:

\[\textbf{w}_{\text{MVDR}}(f) = \frac{{{\bf{\Phi}_{\textbf{NN}}^{-1}}(f){\bm{v}}(f)}} {{\bm{v}^{\mathsf{H}}}(f){\bf{\Phi}_{\textbf{NN}}^{-1}}(f){\bm{v}}(f)} \]
使用 RTFMVDR 的教程
Speech Enhancement with MVDR Beamforming

使用 MVDR 波束賦形進行語音增強

使用 MVDR 波束賦形進行語音增強
forward(specgram: Tensor, rtf: Tensor, psd_n: Tensor, reference_channel: Union[int, Tensor], diagonal_loading: bool = True, diag_eps: float = 1e-07, eps: float = 1e-08) Tensor[原始碼]
引數:
  • specgram (torch.Tensor) – 多通道復值頻譜。維度為 (…, channel, freq, time) 的 Tensor。

  • rtf (torch.Tensor) – 目標語音的復值 RTF 向量。維度為 (…, freq, channel) 的 Tensor。

  • psd_n (torch.Tensor) – 噪聲的復值功率譜密度 (PSD) 矩陣。維度為 (…, freq, channel, channel) 的 Tensor。

  • reference_channel (inttorch.Tensor) – 指定參考通道。如果資料型別是 int,則表示參考通道索引。如果資料型別是 torch.Tensor,其形狀為 (…, channel),其中 channel 維度是 one-hot。

  • diagonal_loading (bool, 可選) – 如果為 True,則對 psd_n 應用對角載入。 (預設值:True)

  • diag_eps (float, 可選) – 對角載入時乘以單位矩陣的係數。僅在 diagonal_loading 設定為 True 時有效。 (預設值:1e-7)

  • eps (float, 可選) – 新增到波束賦形權重公式分母中的值。 (預設值:1e-8)

返回值:

單通道復值增強頻譜,維度為 (…, freq, time)

返回型別:

torch.Tensor

文件

訪問 PyTorch 的完整開發者文件

檢視文件

教程

獲取面向初學者和高階開發者的深度教程

檢視教程

資源

查詢開發資源並獲取問題解答

檢視資源