FFTW interface for MT4
No takers on this one, it seems, so I've started to tinker, but without much success. I have the DLL, and I think I need to use three functions only:
I've tried the following imported functions declarations:
int fftw_plan fftw_plan_r2r_1d(int n, double &in[], double &out[], int kind, int flags);
void fftw_execute(int p);
void fftw_destroy_plan(int p);
in the hope that the opaque pointer may be declared as an int.
Needless to say, things don't work well; I get the "illegal memory read (at address 0x0)" exception.
Would this be because my import declarations are wrong? If so, is there a way that would be right?
Or does my attempted interface seem ok, and it's more likely I mis-feed the DLL with bad inputs?
fftw_plan *fftw_plan fftw_plan_r2r_1d(int n, double *in, double *out, int kind, int flags);
void fftw_execute(fftw_plan *p);
void fftw_destroy_plan(fftw_plan *p);
I've tried the following imported functions declarations:
int fftw_plan fftw_plan_r2r_1d(int n, double &in[], double &out[], int kind, int flags);
void fftw_execute(int p);
void fftw_destroy_plan(int p);
in the hope that the opaque pointer may be declared as an int.
Needless to say, things don't work well; I get the "illegal memory read (at address 0x0)" exception.
Would this be because my import declarations are wrong? If so, is there a way that would be right?
Or does my attempted interface seem ok, and it's more likely I mis-feed the DLL with bad inputs?
I'm primarily interested in obtaining 1-dimensional DFT of real data.