Reputation: 21
I am getting the 2d-fft of an image properly,
But not getting the inverse of from the 2d-fft of that same image.
What are the proper calls for getting inverse from the 2d-fft of that same image ???
// for 2d-fft. This I am getting properly
kiss_fftnd_cfg st = kiss_fftnd_alloc(dims, ndims, 0, 0, 0);
kiss_fftnd(st,(kiss_fft_cpx *)fftbuf,(kiss_fft_cpx *)fftoutbuf);
// for inverse. By using this I am getting the wrong values.
kiss_fftndr_cfg st2 = kiss_fftndr_alloc(dims, ndims, 1, 0, 0);
kiss_fftndri(st2, (kiss_fft_cpx *)fftoutbuf, (kiss_fft_scalar *)obuf);
// even I have tried this. By using this I am getting the wrong values.
kiss_fftr_cfg st3 = kiss_fftr_alloc( (rows * cols) , 1, 0, 0);
kiss_fftri( st3 , (kiss_fft_cpx *)fftoutbuf ,(kiss_fft_scalar *)rbuf);
Upvotes: 1
Views: 227
Reputation: 8506
You are mixing complex and real FFTs.
The forward/inverse behavior is controlled by the 3rd argument inverse_fft
of the *alloc functions (i.e. complex kiss_fftnd_alloc
and real kiss_fftndr_alloc
).
Upvotes: 1