Re: [eigen] FFT for Eigen

[ Thread Index | Date Index | More Archives ]

Thomas Capricelli wrote:

The way fftw works is the following : you create a "plan" (describing dimensions, sizes, type and so on), and you use the plan on data. The idea of course is that you create the plan once and use it several times. I am not sure if this is good or bad wrt to the use of fftw in eigen. Just wanted to mention it.

The concept of a "plan" is a common idiom among kissfft, FFTW, and IMKL.

The responsibility of creating and maintaining this plan would be shared between the FFT class and the traits class. In typical usage, the FFT "plan" will have the same lifetime as the FFT object. This could be tweaked by extending the traits class.


   FFT fft(1024);  // the FFT executive object

fft.fwd( freqVec1, timeVec1 ); // this creates the forward plan for size 1024 // and calculates freqVec1 = FFT(timeVec1)

   fft.fwd(freqVec2, timeVec2) ; // this reuses the previous plan

   freqVec3 = frecVec1 * freqVec2; // or whatever...

fft.inv(timeVec3, freqVec3); // this creates an inverse plan for size 1024
                                // and calculates timeVec3 = IFFT(freqVec3)

} // ~FFT destroys both plans

Mail converted by MHonArc 2.6.19+