[clean-list] FFT with Clean

Siegfried Gonzi siegfried.gonzi@kfunigraz.ac.at
Sat, 04 Nov 2000 13:39:10 +0100


Dear reader,


in the online-tutorial (concerning Clean) from Ana M. Abro someone can
find two
Fast-Fourier implementations; the first one (but not usable for large
arrays: to slow) and a second one with bit-reversed order (see
"Numerical
Recipies" for a reference). The first implementation gives the
calculated
values both as real and complex part, th second implementation gives the

values as real (or absolute values; I could not find out yet, because
the
calculation delivers strange results).

I want not give you the complete code ( but see end of my message), but
only the Start-definition and
the definition of the FFT-calculation:

FFT:: !*{#Real} -> {#Real}
FFT re= power (Fourier (2.0*3.1415926) re (createArray (size re) 0.0))
// and here is the code

The above should calculate the FFT after passing a one-dimensional array

with reals.

So, now comes my problem: what in hell is the Start code doing:

Start:: {#Real}
Start= {xx.[i] \\i<- [1..8]}
where
    xx= FFT delta
    delta = {x \\ x <- ([1.0]++(repeatn 4095 0.0))}


What should that suspected '4095' mean? What say me the above code: I
get
an array with 8 members, where every member is the result of the FFT
from
values ranging from 1,0,0,...0,0,0 (until 4095 zeros) ?
FFT {1.0,0.0,0.0,0.0,0.0...0.0} and that 8 times? I cannot cope with
that.


I would like transfer my Yorick simulation code (spherical aberration
concerning optical telescopes) to a stand-alone Macintosh application
(as
free or shareware). A same simulation (written in Delphi by a guy from
the
Netherlands)  for amateur astronomers exists for Winzigweich and a port
to Unix will be made.

And for that simulation I need the FFT (with a resolution up to
1024x1024
array points). First I thought I can do it with Mops (a Forth
development
environement for the Macintosh), because the Forthler claim that Forth
is
the one and only programming language to be real productive. Oh, Oh I
cannot believe that...are you willing to get insane?...try Forth.


Regards,
S. Gonzi
[If you are intersted in you can access the tutorial via the
Clean-homepage or at:
http://www.deene.ufu.br/clean/clean1.html ]