Forums

Questions about fftw

Started by Unknown April 15, 2006
Hi,

I am using the FFTW library to do some image processing. I am using the
r2c plan to get the fourier transform. The documentation clearly states
that the size of the output for a m*n input is m*(n/2+1). Also, the dc
component of the result is the (0,0) element, rather than at the centre
of the array. So what i need to know is,
1) How is the rest of the fourier transform oriented?
2) Which part of the fourier transform is excluded from the result?
As far as the first question goes, I've found something here :
http://astronomy.swin.edu.au/~pbourke/other/imagefilter/sketch1.gif
I don't know if its what i'm looking for, and i would like it if
someone could confirm that.

Thanks,
Utsav

utsavprabhu@gmail.com wrote:
> Hi, > > I am using the FFTW library to do some image processing. I am using the > r2c plan to get the fourier transform. The documentation clearly states > that the size of the output for a m*n input is m*(n/2+1). Also, the dc > component of the result is the (0,0) element, rather than at the centre > of the array. So what i need to know is, > 1) How is the rest of the fourier transform oriented? > 2) Which part of the fourier transform is excluded from the result? > As far as the first question goes, I've found something here : > http://astronomy.swin.edu.au/~pbourke/other/imagefilter/sketch1.gif > I don't know if its what i'm looking for, and i would like it if > someone could confirm that. > > Thanks, > Utsav >
Here's a hint: http://www.mathworks.com/access/helpdesk/help/techdoc/ref/fftshift.html Good luck, Mike
Hi Mike,

Thanks for the hint. This clears up the first answer, and the sketch i
included is now confirmed. However, itstill leaves me without an answer
to the second question. Another hint for that would be welcome :)

Thanks,
Utsav

For a 2d r2c transform, the "upper-left" corner (the 0th array element)
is still the DC component...only the first ~half of each row is
outputted.  See
http://www.fftw.org/doc/Multi_002dDimensional-DFTs-of-Real-Data.html