Tag Archives: Math

Ruby: Simple Fast Fourier Transform

by far not as powerful as the Fastest Fourier Transform in the West but maybe sometimes useful for a quick data analysis or de-noising. Reads stdin and writes to stdout.

Algorithm taken from Meyberg, Vachenauer: Höhere Mathematik II and ported to plain ruby myself.
< ![CDATA[
#!/usr/bin/env ruby
require ‘complex’

class Array
# DFT and inverse.
#
# Algorithm from
# …