Re: FFTW Fortran Real2Complex R2C output array structure? fftw_plan_dft_r2c_3d?



On Jun 12, 1:16 pm, "Robert S." <r...@xxxxxxxxxxxxxxx> wrote:
I'm using the FFTW package and am using the fortan wrappers
to compute a 3D transform. This I seem to do successfully, however
I can not seem to disentangle the raw output.>From studying the figure on page 8 of the fftw 3.1.2 manual

[...]

(I don't shuffle the 3rd dimension since this runs from 1---ngrid3/2+1
and already
contains just the +ve frequncies.)

Remember that a Fortran array corresponds to a C array with *reversed*
dimensions (column-major vs. row-major format). So, in the C FFTW
interface, for an r2c (real-input) transform the last dimension is cut
in ~half, but in the Fortran interface the *first* dimension is cut in
~half.

This is discussed in the FFTW manual. See the third bullet point of:
http://www.fftw.org/doc/Fortran_002dinterface-routines.html
and the last example of:
http://www.fftw.org/doc/Fortran-Examples.html

Regards,
Steven G. Johnson

.



Relevant Pages

  • Re: FFTW Fortran Real2Complex R2C output array structure? fftw_plan_dft_r2c_3d?
    ... So, in the C FFTW ... for an r2c transform the last dimension is cut ...
    (comp.dsp)
  • FFTW: successive real2complex 1-D FFTs fail
    ... I've been experimenting lately with the great FFTW library in C, ... Perform 1-D FFTs on every row of the same image array ... I first create the plans, then I load the image into fftw_in, and then I ... The strange thing is that the second transform produces wrong results. ...
    (comp.dsp)
  • Re: Neutrino Mass and Supernovae
    ... all transform diffeerntly, even though each has dimension M. ... > exchanges momentum when the floton is decaccelerated by some ... both the time and the spatial derivatives are zero. ...
    (sci.physics)
  • fftw - loosing accuracy in cosine transform
    ... Sorry if this is a wrong place for posting fftw related question. ... transform as opposed to the fouerier transform? ... in cosine transform it is O. ... sample array contains input to the FFTW program ...
    (comp.lang.fortran)
  • Re: FFTW library
    ... Now what I am doing is looping the other dimension and call ... the advanced FFTW interface allows you to do multiple FFTs in a ... call dfftw_plan_many_r2r(forwd, rank, dim2, howmany, x, dim2, stride, ... you have an array xand are transforming the dim2 direction ...
    (comp.lang.fortran)