Discrete Fourier Transform in Ruby
...Just for a laugh... I'm reading this amazing book at the moment, http://www.dspguide.com/ and thought it would be fun to code some stuff in Ruby. The code... #!/usr/bin/ruby require 'complex' class DFT def initialize( size ) @freq = Array.new( size, Complex(0,0) ) end # set data def data( data ) @data = data end # get frequency table def freq @freq end # reset the frequency table def reset @freq.map! do |...