快捷鍵

RTFMVDR

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

基於相對轉移函數 (RTF) 和雜訊功率譜密度 (PSD) 矩陣的最小變異數無失真響應 (MVDR [[Capon, 1969]](#id34)) 模組。

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\) 個頻率箱的 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) 的張量

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

  • psd_n (torch.Tensor) – 雜訊的複數值功率譜密度 (PSD) 矩陣。維度為 (…, freq, channel, channel) 的張量。

  • reference_channel (inttorch.Tensor) – 指定參考聲道。如果 dtype 為 int,則代表參考聲道索引。如果 dtype 為 torch.Tensor,則其形狀為 (…, channel),其中 channel 維度為 one-hot。

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

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

  • eps (float, optional) – 要加到波束成形權重公式分母的值。(預設值:1e-8)

返回:

單聲道複數值增強頻譜,維度為 (…, freq, time)

返回類型:

torch.Tensor

文件

存取 PyTorch 的完整開發者文件

檢視文件

教學

取得初學者和進階開發者的深入教學

檢視教學

資源

尋找開發資源並獲得問題解答

檢視資源