// file: $isip/class/algo/FourierTransform/FourierTransformFh.h // version: $Id: FourierTransformFh.h 6436 2001-03-05 23:59:37Z peng $ // // This file defines the functions required by the FHT code // // this header file is a part of the public domain fht code by ron mayer. // this is supposedly proprietary. // // this code is based on the algorithm as described in the work by ron // mayer whose code is available as a free-ware. the algorithm is // described in the paper: // // Hsieh S. Hou, "the fast hartley transform algorithm", IEEE // Transactions on Computers, pp. 147-153, February 1987. // // isip include files // // make sure definitions are only made once // #ifndef ISIP_FT_FHT #define ISIP_FT_FHT // the fht code seems to require these macro definitions // it is called from within the fht routine and cannot be // removed. // #ifdef FT_FHT_GOOD_TRIG #else #define FT_FHT_FAST_TRIG #endif #if defined(FT_FHT_GOOD_TRIG) #define FHT_SWAP(a,b,t) {(t)=(a);(a)=(b);(b)=(t);} #define TRIG_VARS \ int32 t_lam = 0; \ #define TRIG_INIT(k,c,s) \ { \ int32 i; \ for (i=2 ; i<=k ; ++i) { \ coswrk[i]=costab[i];sinwrk[i]=sintab[i]; } \ t_lam = 0; \ c = 1; \ s = 0; \ } #define TRIG_NEXT(k,c,s) \ { \ int32 i,j; \ ++(t_lam); \ for (i=0 ; !(1 << i))&(int32)t_lam) ; ++i); \ i = k - i; \ s = sinwrk[i]; \ p = t_lam; \ c = coswrk[i]; \ fprintf(stdout, "%d\n", (t_lam)); \ if (i>1) \ { \ for (j=k-i+2 ; (1<