Module: DTAS::Util

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:



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

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

#linear_to_db(val) ⇒ Object



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

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