! Copyright (c) 2012 John Benediktsson
! See http://factorcode.org/license.txt for BSD license.
-USING: arrays kernel locals math math.constants math.functions
-math.vectors sequences sequences.extras sequences.private ;
+USING: kernel math math.constants math.functions
+math.vectors sequences sequences.extras ;
IN: math.transforms.fft
<PRIVATE
! Discrete Fourier Transform
:: (slow-fft) ( seq inverse? -- seq' )
seq length :> N
- inverse? 1 -1 ? 2pi * N / N iota n*v :> omega
- N iota [| k |
+ inverse? 1 -1 ? 2pi * N / N <iota> n*v :> omega
+ N <iota> [| k |
0 seq omega [ k * cis * + ] 2each
inverse? [ N / ] when
] map ; inline