From: Steven G. Johnson on
On Apr 16, 6:01 pm, "Jorge" <jleandrope...(a)gmail.com> wrote:
> forward = fftwf_plan_r2r_1d(SIZE_OF_IN, in, out, FFTW_R2HC,
> FFTW_FORWARD | FFTW_ESTIMATE );
> backwards = fftwf_plan_r2r_1d(SIZE_OF_IN, out, out2, FFTW_HC2R,
> FFTW_BACKWARD | FFTW_ESTIMATE );

You shouldn't be passing FFTW_FORWARD or FFTW_BACKWARD, either. These
do not belong in the "flags" argument. The sign of the transform is
specified by the 4th argument (FFTW_R2HC == forward, FFTW_HC2R ==
backward). i.e. do:

forward = fftwf_plan_r2r_1d(SIZE_OF_IN, in, out, FFTW_R2HC,
FFTW_ESTIMATE );
backwards = fftwf_plan_r2r_1d(SIZE_OF_IN, out, out2, FFTW_HC2R,
FFTW_ESTIMATE );

Please also note the normalization that I mentioned before. Upon
executing the two plans in sequence, out2[i] will be in[i] *
SIZE_OF_IN, plus a small relative error on the order of the floating-
point precision (1e-7 or so in single precision).

Steven

From: Jorge on
Thank you very much Steven!!!

Regards


On 16 abr, 19:25, "Steven G. Johnson" <stev...(a)alum.mit.edu> wrote:
> On Apr 16, 6:01 pm, "Jorge" <jleandrope...(a)gmail.com> wrote:
>
> > forward = fftwf_plan_r2r_1d(SIZE_OF_IN, in, out, FFTW_R2HC,
> > FFTW_FORWARD | FFTW_ESTIMATE );
> > backwards = fftwf_plan_r2r_1d(SIZE_OF_IN, out, out2, FFTW_HC2R,
> > FFTW_BACKWARD | FFTW_ESTIMATE );
>
> You shouldn't be passing FFTW_FORWARD or FFTW_BACKWARD, either. These
> do not belong in the "flags" argument. The sign of the transform is
> specified by the 4th argument (FFTW_R2HC == forward, FFTW_HC2R ==
> backward). i.e. do:
>
> forward = fftwf_plan_r2r_1d(SIZE_OF_IN, in, out, FFTW_R2HC,
> FFTW_ESTIMATE );
> backwards = fftwf_plan_r2r_1d(SIZE_OF_IN, out, out2, FFTW_HC2R,
> FFTW_ESTIMATE );
>
> Please also note the normalization that I mentioned before. Upon
> executing the two plans in sequence, out2[i] will be in[i] *
> SIZE_OF_IN, plus a small relative error on the order of the floating-
> point precision (1e-7 or so in single precision).
>
> Steven