1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
#include <complex>
#include <fftw3.h>
void transformeeFourierComplex(complex<double> *curve, complex<double> *descriptor, int n)
{
fftw_plan plan;
plan = fftw_plan_dft_1d(n, reinterpret_cast<fftw_complex*>(curve), reinterpret_cast<fftw_complex*>(descriptor), FFTW_FORWARD, FFTW_ESTIMATE);
fftw_execute(plan);
/*liberation de la memoire*/
fftw_destroy_plan(plan);
return;
}
void transformeeFourierInv(complex<double> *descriptor, complex<double> *curve, int n)
{
fftw_plan plan;
plan = fftw_plan_dft_1d(n, reinterpret_cast<fftw_complex*>(descriptor), reinterpret_cast<fftw_complex*>(curve), FFTW_BACKWARD, FFTW_ESTIMATE);
fftw_execute(plan);
fftw_destroy_plan(plan);
} |
Partager