Class: Noyes::ULaw

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_impl/compression.rb

Instance Method Summary collapse

Instance Method Details

#<<(data) ⇒ Object


4
5
6
7
8
9
10
11
# File 'lib/ruby_impl/compression.rb', line 4

def << data
  result = data.map do |cmn|
    cmn.map do |x|
      e2x = Math::E ** x.abs
      Math.log(1 + 255 * e2x) / Math.log(1 + e2x)
    end
  end
end