Class: Noyes::Compressor

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

Instance Method Summary collapse

Instance Method Details

#<<(data) ⇒ Object


15
16
17
18
19
20
21
22
23
24
# File 'lib/ruby_impl/compression.rb', line 15

def << data
  @last = Array.new(data.first.size){0.0} unless @last
  result = data.map do |signal|
    signal.zip(@last).map do |both|
      both[0] - both[1]
    end
  end
  @last = data.last
  result
end