class SPCore::CosineWindow
Produces a Cosine window of a given size (number of samples). For more info, see en.wikipedia.org/wiki/Window_function#Cosine_window.
Attributes
data[R]
Public Class Methods
new(size)
click to toggle source
# 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