快捷方式

torchaudio.functional.amplitude_to_DB

torchaudio.functional.amplitude_to_DB(x: Tensor, multiplier: float, amin: float, db_multiplier: float, top_db: Optional[float] = None) Tensor[source]

將頻譜圖從功率/振幅尺度轉換為分貝尺度。

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

批次中每個張量的輸出取決於該張量的最大值,因此將音訊剪輯分割成片段與完整剪輯可能會傳回不同的值。

參數:
  • x (Tensor) –

    轉換為分貝尺度前的輸入頻譜圖。預期的形狀為 (freq, time)(channel, freq, time)(..., batch, channel, freq, time)

    注意

    當指定 top_db 時,會為批次中的每個音訊計算截止值。 因此,如果輸入形狀為 4D(或更大),則批次中的音訊資料會使用不同的截止值。如果輸入形狀為 2D 或 3D,則使用單一截止值。

  • multiplier (float) – 功率使用 10.,振幅使用 20.

  • amin (float) – 用於鉗制 x 的數字

  • db_multiplier (float) – Log10(max(參考值和 amin))

  • top_db (floatNone, optional) – 分貝的最小負截止值。 合理的數字是 80。(預設:None

返回:

分貝尺度的輸出張量

返回類型:

Tensor

文件

Access comprehensive developer documentation for PyTorch

View Docs

教學

Get in-depth tutorials for beginners and advanced developers

View Tutorials

資源

Find development resources and get your questions answered

View Resources