Commit 61cbf791 authored by moto's avatar moto Committed by Facebook GitHub Bot
Browse files

Amend amp_to_db docstring (#3519)

Summary:
Context: https://github.com/pytorch/audio/issues/3448

The documentation of amplitude_to_DB is ambigious on how cut-off values are computed when the input tensor is 3D.

This commit clarifies that.

Closes: https://github.com/pytorch/audio/issues/3448

Pull Request resolved: https://github.com/pytorch/audio/pull/3519

Reviewed By: huangruizhe

Differential Revision: D47875505

Pulled By: mthrok

fbshipit-source-id: e06bb997e7a27e2abe35c8e2ac91ddfbded4e641
parent 2c8665de
......@@ -372,9 +372,17 @@ def amplitude_to_DB(
Args:
x (Tensor): Input spectrogram(s) before being converted to decibel scale. Input should take
the form `(..., freq, time)`. Batched inputs should include a channel dimension and
have the form `(batch, channel, freq, time)`.
x (Tensor): Input spectrogram(s) before being converted to decibel scale.
The expected shapes are ``(freq, time)``, ``(channel, freq, time)`` or
``(..., batch, channel, freq, time)``.
.. note::
When ``top_db`` is specified, cut-off values are computed for each audio
in the batch. Therefore if the input shape is 4D (or larger), different
cut-off values are used for audio data in the batch.
If the input shape is 2D or 3D, a single cutoff value is used.
multiplier (float): Use 10. for power and 20. for amplitude
amin (float): Number to clamp ``x``
db_multiplier (float): Log10(max(reference value and amin))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment