Sha256: c59af07784b68e5aa8236189e27599eb542be6f13f63ed989ca02872e279529c
Contents?: true
Size: 365 Bytes
Versions: 9
Compression:
Stored size: 365 Bytes
Contents
module SPCore # Produces a Hann window of a given size (number of samples). # For more info, see https://en.wikipedia.org/wiki/Window_function#Hann_.28Hanning.29_window. class HannWindow attr_reader :data def initialize size @data = Array.new(size) size.times do |n| @data[n] = 0.5 * (1 - Math::cos((TWO_PI * n)/(size - 1))) end end end end
Version data entries
9 entries across 9 versions & 1 rubygems