http://www.jsoftware.com/jwiki/Essays/FFT
cube =: ($~ q:@#) :. ,
roots =: +...@]^:(0>[) (_1^2%]) ^ i...@-:
floop =: 4 : 'for_r. i.#$x do. (y=.{."1 y) ] x=.(+/x) ,&,:"r (-/x)*y end.'
fft =: (] floop&.cube 1&ro...@#) f. :. ifft
This is a rare practical use of a high rank array.
("High" means greater than 4, say.) The only other
"use" that I know of is the complete tensor of order n.
http://www.jsoftware.com/help/dictionary/dccapdot.htm
The expression ,&,:"r in floop can be simplified to ,:"r
if r is nonzero. This suggested that perhaps the definition
of atom0 ,: atom1 is incorrect. (Should have shape 2
instead of 2 1.)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm