next up previous contents index
Next: Module SkyMap Up: Module NTools Previous: Integration, Differential equations   Contents   Index


Fourier transform (FFT)

An abstract interface for performing FFT operations is defined by the FFTServerInterface class. The FFTPackSever class implements one dimensional FFT, on real and complex data. FFTPackServer uses an adapted and extended version of FFTPack (available from netlib), translated in C, and can operate on single and double precision ( float, double) data.

The sample code below illustrates the use of FFTServers:


#include "fftpserver.h"
   // ...
TVector<r_8> in(32);
TVector< complex<r_8> > out;
in = RandomSequence();
FFTPackServer ffts;
ffts.setNormalize(true);  // To have normalized transforms
cout << " FFTServer info string= " << ffts.getInfo() << endl;
cout << "in= " << in << endl;
cout << " Calling ffts.FFTForward(in, out) : " << endl;
ffts.FFTForward(in, out);
cout << "out= " << out << endl;



Reza Ansari
2001-03-07