Sha256: f051cc46476e0e1abceedf7d87a43febbfd889a8d852da2c3076e1fd639b36ef

Contents?: true

Size: 224 Bytes

Versions: 42

Compression:

Stored size: 224 Bytes

Contents

class Numeric

  #
  # +ampdb+: linear to dB converter
  #
  # interprets its receiver as a linear value and returns it in dB
  #
  def ampdb
    raise Mext::NegativeNumeric if self < 0.0
    20*Math::log10(self)
  end

end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
ruby-mext-0.3.1 lib/mext/numeric/ampdb.rb
ruby-mext-0.3.0 lib/mext/numeric/ampdb.rb