DSPRelated.com
Forums

2D FFT's and FFTW

Started by Michel Rouzic July 22, 2005
There's is something that I don't understand about FFTW. I already
successfully performed FFT's in 1D (for sound), but when it comes to
images, there's something that i dont understand and dont know how to
deal with :

fftw_plan fftw_plan_r2r_2d(int nx, int ny, double *in, double *out,
fftw_r2r_kind kindx, fftw_r2r_kind kindy, unsigned flags);

what i dont understand in this is the double *in and double *out
arguments. I'm trying to perform a FFT in 2D, but it looks like the
input and output have to be in 1D, and since my image data is stored as
double **in, i don't know how to deal with that but to put in[0] and
out[0] instead, not even knowing how to interpret the 2 dimensional
result.

i'm very confused, can someone clear that up for me?

When all else fails, you might try reading the manual.

First, there is a section of the manual on multi-dimensional array
format that specifically describes FFTW's storage and contrasts it with
the "array of pointers to arrays" format that you are using.

Second, the description of the r2r transform format specifically
suggests that you use fftw_plan_dft_r2c_2d etc. for multi-dimensional
DFTs.

Cordially,
Steven G. Johnson