JUCE
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Static Public Member Functions | List of all members
Decibels Class Reference

This class contains some helpful static methods for dealing with decibel values. More...

Static Public Member Functions

template<typename Type >
static Type decibelsToGain (const Type decibels, const Type minusInfinityDb=(Type) defaultMinusInfinitydB)
 Converts a dBFS value to its equivalent gain level.
 
template<typename Type >
static Type gainToDecibels (const Type gain, const Type minusInfinityDb=(Type) defaultMinusInfinitydB)
 Converts a gain level into a dBFS value.
 
template<typename Type >
static String toString (const Type decibels, const int decimalPlaces=2, const Type minusInfinityDb=(Type) defaultMinusInfinitydB)
 Converts a decibel reading to a string, with the 'dB' suffix.
 

Detailed Description

This class contains some helpful static methods for dealing with decibel values.

Member Function Documentation

template<typename Type >
static Type Decibels::decibelsToGain ( const Type  decibels,
const Type  minusInfinityDb = (Type) defaultMinusInfinitydB 
)
static

Converts a dBFS value to its equivalent gain level.

A gain of 1.0 = 0 dB, and lower gains map onto negative decibel values. Any decibel value lower than minusInfinityDb will return a gain of 0.

template<typename Type >
static Type Decibels::gainToDecibels ( const Type  gain,
const Type  minusInfinityDb = (Type) defaultMinusInfinitydB 
)
static

Converts a gain level into a dBFS value.

A gain of 1.0 = 0 dB, and lower gains map onto negative decibel values. If the gain is 0 (or negative), then the method will return the value provided as minusInfinityDb.

References jmax().

template<typename Type >
static String Decibels::toString ( const Type  decibels,
const int  decimalPlaces = 2,
const Type  minusInfinityDb = (Type) defaultMinusInfinitydB 
)
static

Converts a decibel reading to a string, with the 'dB' suffix.

If the decibel value is lower than minusInfinityDb, the return value will be "-INF dB".


The documentation for this class was generated from the following file: