# How can DFT of a two dimensional array be found using program for one dimensional DFT in C?

I have the program four1.c from Numerical Recipes in C to calculate the Discrete Fourier Transform (DFT) of a one dimensional array. I want to calculate the DFT of a two dimensional array using four1.c, how can I do it?

• Why not just use a 2-dimensional FFT library? – Bill Barth Sep 2 '14 at 20:15
• I think @BillBarth is right, why not use something like FFTW? – Kirill Sep 3 '14 at 14:29
• Yeah, I'd just use a 2-D FFT library. Hypothetically, one might object to using a GPL'd library. SciPy uses FFTPACK instead of FFTW due to licensing issues, and FFTPACK only implements 1-D transforms, so SciPy implements $n$-D FFTs by composing 1-D FFTs from FFTPACK. (For an in-house tool not intended for distribution, it's all moot anyway.) – Geoff Oxberry Sep 4 '14 at 1:31