Class: SPCore::CosineWindow

Inherits:
Object
  • Object
show all
Defined in:
lib/spcore/windows/cosine_window.rb

Overview

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(size) ⇒ CosineWindow

Returns a new instance of CosineWindow.



6
7
8
9
10
11
# File 'lib/spcore/windows/cosine_window.rb', line 6

def initialize size
  @data = Array.new size
  size.times do |n|
    @data[n] = Math::sin((Math::PI * n)/(size - 1))
  end
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



5
6
7
# File 'lib/spcore/windows/cosine_window.rb', line 5

def data
  @data
end