nvidia.dali.experimental.dynamic.to_decibels#

nvidia.dali.experimental.dynamic.to_decibels(input, /, *, batch_size=None, device=None, cutoff_db=None, multiplier=None, reference=None)#

Converts a magnitude (real, positive) to the decibel scale.

Conversion is done according to the following formula:

min_ratio = pow(10, cutoff_db / multiplier)
out[i] = multiplier * log10( max(min_ratio, input[i] / reference) )
Supported backends
  • ‘cpu’

  • ‘gpu’

Parameters:

input (Tensor/Batch) – Input to the operator.

Keyword Arguments:
  • cutoff_db (float, optional, default = -200.0) –

    Minimum or cut-off ratio in dB.

    Any value below this value will saturate. For example, a value of cutoff_db=-80 corresponds to a minimum ratio of 1e-8.

  • multiplier (float, optional, default = 10.0) – Factor by which the logarithm is multiplied. The value is typically 10.0 or 20.0, which depends on whether the magnitude is squared.

  • reference (float, optional, default = 0.0) –

    Reference magnitude.

    If a value is not provided, the maximum value for the input will be used as reference.

    Note

    The maximum of the input will be calculated on a per-sample basis.