Simple fft question

Simple fft question

Hi,

I am trying to use the fft routine(for the first time), cfft1dc but it seems not to work the way I thought it should.

Here is the code:

void fft_init(INTEGER N) {

#ifdef WIN32

wsave = FLOAT_ALLOC(3*N);

#endif

}

void fft_deinit() {

#ifdef WIN32

FLOAT_FREE(wsave);

#endif

}

void fft(FLOAT* real_input, FLOAT* imag_input, FLOAT* real_output, FLOAT* imag_output, INTEGER N) {

cblas_scopy(N, real_output, 1, real_input, 1);

cblas_scopy(N, imag_output, 1, imag_input, 1);

cfft1dc(real_output, imag_output, N, 0, wsave);

cfft1dc(real_output, imag_output, N, -1, wsave);

}

As I understood from the doc, wsave is an output parameter if isign=0 and if isign!=0,

wsave contains the FFT coeff initialized on a prevoius call with isign=0.

So, where do I miss the thing?

Regards, Per

1 contenuto / 0 nuovi
Per informazioni complete sulle ottimizzazioni del compilatore, consultare l'Avviso sull'ottimizzazione