The Window classes don't have any parent class specified. A common Window superclass could be provided, or even the Array or Signal class might be appropriate superclasses. What is probable appropriate is a Window superclass, like this:
class Window
attr_reader :data
def initialize data
@data = data
end
# Produces a Cosine window of a given size (number of samples).
# For more info, see https://en.wikipedia.org/wiki/Window_function#Cosine_window.
class Cosine < Window
def initialize size
data = Array.new(size) do |n|
Math::sin((Math::PI * n)/(size - 1))
end
super(data)
end
end
...
end
The Window classes don't have any parent class specified. A common Window superclass could be provided, or even the Array or Signal class might be appropriate superclasses. What is probable appropriate is a Window superclass, like this: