From stegu@itn.liu.se Mon Oct 20 01:05:02 2003 Return-Path: Message-ID: <3F931807.50202@itn.liu.se> Date: Mon, 20 Oct 2003 01:02:31 +0200 From: Stefan Gustavson MIME-Version: 1.0 To: arndt@jjj.de Subject: kube_fft.c - Modernised and cleaned up! I was looking for a simple, compact FFT routine and found "kube_fft.c" on your FFT page. From the look of it, nobody has been near that code for ages, because it was still in K&R syntax and was in desperate need of some structure and a header file. :[ I still liked the code, though, because it was simple and compact, and reasonably fast for its age. So, I cleaned up the code, put the typedefs and the proper "extern" entry points into a relevant header, and added a couple of routines to perform double-precision transforms while I was at it, since the actual calculations in "FFT842" take place on double data anyway. I reckon a proper "float" inner loop would make the single precision transform faster, but I have not tried that yet. The transform is not super optimized anyway, so I let it be. This is the result. Feel free to distribute it on your FFT page if you like. The old "kube_fft.c" is really too old to be useful, so I suggest you remove it unless you want to keep it for sentimental reasons. Apart from its ancient syntax which won't compile without warnings on modern compilers, the code structure (or lack of structure) is very weird, with everything being declared as "extern" for no reason. My version is exactly the same algorithm, I just updated the syntax to ANSI C, changed some spelling of variables and function names, and put some structure to the code. Sincerely, Stefan Gustavson (stegu@itn.liu.se)