Index of /knowledgemedia/MIDI/UNIX/CMIX/CMD/FFT

      Name                    Last modified       Size  Description

[DIR] Parent Directory 11-Jun-2003 14:50 - [TXT] COMPLEXF.H 11-Jun-2003 14:50 1k [TXT] DIFFOUT 11-Jun-2003 14:50 3k [TXT] FFT.C 11-Jun-2003 14:50 1k [TXT] FFT.O 11-Jun-2003 14:50 1k [TXT] IEEEDATA 11-Jun-2003 14:50 1k [TXT] IEEEINVR 11-Jun-2003 14:50 1k [TXT] IEEEOUT 11-Jun-2003 14:50 1k [TXT] MAIN.C 11-Jun-2003 14:50 6k [TXT] MAIN.O 11-Jun-2003 14:50 6k [TXT] RENAME.BAT 11-Jun-2003 14:50 1k

here are the fft files
the transform itself is in fft.c
the main.c program has all kinds of useful macros in it and is
90% there as far as a standalone sampling program of any kind of
file -
IEEEdata is from the IEEE signal processing book - 
IEEEout is a forward transform of that data -
IEEEinverse is the "re-synthesized" IEEEdata (i.e., an inverse transform
of IEEEout) - the slight differences are normal.

you should be able to find a macro in main.c to "convert" real data 
to complex data

If you want to use this a.out, input file types are -aAfF (lc for real,
uc for complex), output file types are -o aAfF, -r gets inverse transform -
I think -m is the size of the fft and -n is the number of ffts to take.
e.g.
a.out -A -o A < IEEEdata > IEEEout         
will put forward transform of ascii (oops, thats what the A means) complex
IEEEdata in ascii complex IEEEout
a.out -A -o A -r < IEEEout > IEEEinverse 
will make ascii complex IEEEinverse as above

a.out -f -O F < floatdata > floattransform
will do a real to complex floating point transform of floatdata and
put the complex values in floattransform, etc.

there are a couple of bugs in the main program (it seems sometimes the
-m, for instance, doesnt work - the default right now is 32 points) -
I kind of left this but I think it will only take me a "day" to fix
it up - 
the main program print five warnings when compiled and takes a LONG time, 
I'm passing it on to you so that you can see how to use the subroutine
and use the conversion macros in some form or another.

There are much better FFTS for audio signal processing - but this at least
works.  Repeated FFTS on big arrays could probably be optimized 100s of %,
which I'm sure to get around to sometime.