- Main Page
- Modules
- Namespaces
- Classes
- Files

# Global Decibel Functions

Convert to and from dB values from amplitude or energy coefficient values. More...

## Functions
template<class Type>
Type | dBCoefficient (Type x, Type ref=1.0)
| Return coefficient corresponding to a ratio of Real dB values.
template<class Type>
Type | dBSPL (Type x, Type ref=1.0)
| Return the dB SPL of two amplitudes.
template<class Type>
Type | dBSIL (Type x, Type ref=1.0)
| Return the dB SIL of two amplitudes.

## Detailed Description

Convert to and from dB values from amplitude or energy coefficient values.

## Function Documentation

template<class Type>

Type dBCoefficient | ( | Type | x,
|  | Type | ref = `1.0` |
| ) |  |  | `[inline]`

Return coefficient corresponding to a ratio of Real dB values.

Note: Type must be floating point type.

Parameters:

  | x | dBSPL amplitude
  | ref | dBSPL reference amplitude (defaults to 1.0)

Definition at line 32 of file Dynamics.h.

References Return.

    00032 { Return( pow(10.0, x / 20.0 ) / ref); }

template<class Type>

Type dBSIL | ( | Type | x,
|  | Type | ref = `1.0` |
| ) |  |  | `[inline]`

Return the dB SIL of two amplitudes.

Note: Type must be floating point type.

Parameters:

  | x | dBSIL amplitude
  | ref | dBSIL reference amplitude (defaults to 1.0)

Definition at line 45 of file Dynamics.h.

References Return.

    00045 { Return 10.0 * log10(x / ref); }

template<class Type>

Type dBSPL | ( | Type | x,
|  | Type | ref = `1.0` |
| ) |  |  | `[inline]`

Return the dB SPL of two amplitudes.

Note: Type must be floating point type.

Parameters:

  | x | dBSPL amplitude
  | ref | dBSPL reference amplitude (defaults to 1.0)

Definition at line 39 of file Dynamics.h.

References Return.

    00039 { Return 20.0 * log10(x / ref); }