Module: DTAS::Util

Included in:
RGState
Defined in:
lib/dtas/util.rb

Overview

in case we need to convert DB values to a linear scale

Instance Method Summary collapse

Instance Method Details

#db_to_linear(val) ⇒ Object

:nodoc:


8
9
10
# File 'lib/dtas/util.rb', line 8

def db_to_linear(val)
  Math.exp(val * Math.log(10) * 0.05)
end

#linear_to_db(val) ⇒ Object


12
13
14
# File 'lib/dtas/util.rb', line 12

def linear_to_db(val)
  Math.log10(val) * 20
end