\File{fft.h},{03:08},{Jan  8 1998}
\L{\LB{\C{}\/* \$Id: fft.h,v 1.10 1998\/01\/04 07:20:34 bert Exp \$}}
\L{\LB{ *}}
\L{\LB{ * Prototypes for many generations of Fast Fourier Transform algorithms.}}
\L{\LB{ *\/\CE{}}}
\L{\LB{}}
\L{\LB{\K{\#ifndef} \_FFT\_H}}
\L{\LB{\K{\#define} \_FFT\_H}}
\L{\LB{}}
\L{\LB{\K{\#include} \S{}\"complex.h\"\SE{}}}
\L{\LB{}}
\L{\LB{\K{\#ifdef} FFTW}}
\L{\LB{\K{\#include} \<fftw.h\>}}
\L{\LB{\K{\#endif} \C{}\/* FFTW *\/\CE{}}}
\L{\LB{}}
\L{\LB{\C{}\/* reference implementation from Numerical Recipes, applied to 2D *\/\CE{}}}
\L{\LB{}}
\L{\LB{\K{void} nr\_fft2(\K{real}[], \K{unsigned} \K{long}, \K{int});}}
\L{\LB{}}
\L{\LB{\C{}\/* old 2D FFT implementations *\/\CE{}}}
\L{\LB{}}
\L{\LB{\K{void}   offt2(\K{real}[], \K{unsigned} \K{long}, \K{int});}}
\L{\LB{\K{void}  drfft2(\K{real}[], \K{unsigned} \K{long}, \K{int});}}
\L{\LB{}}
\L{\LB{\C{}\/* context\-based, DIT\/DIF implementations *\/\CE{}}}
\L{\LB{}}
\L{\LB{\K{typedef} \K{struct} FFT\_Context\_Data \{}}
\L{\LB{  \K{unsigned} \K{long} nn;}}
\L{\LB{  \K{int} isign;}}
\L{\LB{  \K{complex} *Wbase;}}
\L{\LB{  \K{complex} *Wexp;}}
\L{\LB{\} *FFT\_Context;}}
\L{\LB{}}
\L{\LB{FFT\_Context init\_nfft2 (\K{unsigned} \K{long}, \K{int});}}
\L{\LB{FFT\_Context init\_mfft2 (\K{unsigned} \K{long}, \K{int});}}
\L{\LB{\K{void}   nfft2(\K{complex}[], FFT\_Context);}}
\L{\LB{\K{void}   mfft2(\K{complex}[], FFT\_Context);}}
\L{\LB{}}
\L{\LB{\C{}\/* interface to either one of the above or FFTW.}}
\L{\LB{ *}}
\L{\LB{ * Since literature often defines \"forward\" and \"backward\" direction}}
\L{\LB{ * differently, and I tend to get confused by which convention I\'m}}
\L{\LB{ * using this week, I\'ll just use \"positive\" and \"negative\", according}}
\L{\LB{ * to the sign in the exponential.}}
\L{\LB{ *\/\CE{}}}
\L{\LB{}}
\L{\LB{\K{\#ifdef} FFTW}}
\L{\LB{}}
\L{\LB{\K{extern} fftwnd\_plan \_Wpos, \_Wneg;}}
\L{\LB{\K{void} \_W\_fft\_plan\_init(\K{int},\K{int});}}
\L{\LB{\K{void} \_W\_fft\_plan\_destroy(\K{void});}}
\L{\LB{\K{\#define} fft2\_init(size)            \_W\_fft\_plan\_init(size, size)}}
\L{\LB{\K{\#define} fft2\_end()                 \_W\_fft\_plan\_destroy()}}
\L{\LB{}}
\L{\LB{\K{\#define} \_fft2(plan,data)           fftwnd((plan), 1, (data), 1, 0, NULL, 0, 0)}}
\L{\LB{\K{\#define} positive\_fft2(data, size)  \_fft2(\_Wpos,(FFTW\_COMPLEX*)(data))}}
\L{\LB{\K{\#define} negative\_fft2(data, size)  \_fft2(\_Wneg,(FFTW\_COMPLEX*)(data))}}
\L{\LB{}}
\L{\LB{\K{\#else} \C{}\/* not FFTW *\/\CE{}}}
\L{\LB{}}
\L{\LB{\K{\#define} fft2\_init(size)}}
\L{\LB{\K{\#define} fft2\_end()}}
\L{\LB{}}
\L{\LB{\K{\#define} positive\_fft2(data, size)  drfft2((\K{real}*)(data),(size), +1)}}
\L{\LB{\K{\#define} negative\_fft2(data, size)  drfft2((\K{real}*)(data),(size), \-1)}}
\L{\LB{}}
\L{\LB{\K{\#endif} \C{}\/* not FFTW *\/\CE{}}}
\L{\LB{}}
\L{\LB{\K{\#endif}}}
