Fast Fourier transform: Difference between revisions
Content deleted Content added
Line 4: | Line 4: | ||
=={{header|J}}== |
=={{header|J}}== |
||
Based on [[j:Essays/FFT]], with some simplifications, sacrificing accuracy not visible here for clarity: |
|||
From [[j:Essays/FFT]]: |
|||
<lang j>cube =: |
<lang j>cube =: $~ q:@# |
||
roots =: +@]^:(0>[) (_1^2%]) ^ i.@-: |
roots =: +@]^:(0>[) (_1^2%]) ^ i.@-: |
||
rou =: [: |
rou =: [: j./ 2 1 o./ o.@(% #)@i.@-: |
||
floop =: 4 : 'for_r. i.#$x do. (y=.{."1 y) ] x=.(+/x) ,&,:"r (-/x)*y end.' |
floop =: 4 : 'for_r. i.#$x do. (y=.{."1 y) ] x=.(+/x) ,&,:"r (-/x)*y end.' |
||
fft =: ( ] floop&.cube rou@#) f. :. ifft |
fft =: ( ] floop&.cube rou@#) f. :. ifft |