Sha256: aba9f62169ed52f00c40b73872c58b203d809f4add9f051dc79eaa6f1805a00d
Contents?: true
Size: 412 Bytes
Versions: 9
Compression:
Stored size: 412 Bytes
Contents
module SPCore # Produces a Hamming window of a given size (number of samples). # For more info, see https://en.wikipedia.org/wiki/Window_function#Hamming_window. class HammingWindow attr_reader :data def initialize size @data = Array.new size alpha = 0.54 beta = 1.0 - alpha size.times do |n| @data[n] = alpha - (beta * Math::cos((TWO_PI * n) / (size - 1))) end end end end
Version data entries
9 entries across 9 versions & 1 rubygems