I am currently using the following matlab function:
function out = fft_2d(in)
out = fftshift(fft2(ifftshift(in)));
As I understand it, this takes a "natural order" input, in, and "swaps" it to be passed to fft2, and then shifts the result of fft2 again using fftshift to give me back the natural ordering output. is this correct?
I am porting this code to C, and I want to use CUFFT to do this. According to the docs, I think I would use:
/* Create a 2D FFT plan. */
cufftPlan2d(&plan, NX, NY, CUFFT_C2R);
/* Use the CUFFT plan to transform the signal out of place. */
cufftExecC2R(plan, idata, odata);
But what kind of shifting will I have to do to the data coming out of cufftExecC2R? Also, does odata need to be a NX*NY block of contiguous data? Does it have to be in column or row major order? Row i'd guess, since thats what C is.
Thanks