Actually once you understand fftc1 there is virtually nothing else
left to fftcn. A multi-dimensional Fourier transform simply consists
of successive one-dimensional transforms in every dimension. So all
fftcn does is loop through the dimensions calling fftc1. The only
tricky part about doing this is setting all the right skips
correctly. For example, consider the middle dimension of a three
dimensional array of size . Each DFT will be of length
and there will be
of them. The skip between
successive elements of the transform will be
. There will be
transforms beginning at the elements
but the next one
will begin at
. All of these stepsizes and skips are
kept track of automatically by fftcn, and following the code itself is
probably easier than following any explanation I could write of it.
Inverse transforms are done exactly the same as forward ones, only with all the calls to fftc1 being made for inverse transforms.