You didn’t mention what you want to do next, so I assume (maybe incorrectly) that what you want is a complex to complex transform.

I spent weeks/months using the R2C and C2R and wondered why I never got meaningful results out of it after operating the elements. The R2C/C2R transforms exploit the hermitian symmetry to calculate the transform outputting just half+1 elements. However, the moment I manipulated these elements, I broke the symmetry, thus messing up the inverse transform.

Then I learned here that what I really needed was the C2C so it would work like how we learn from the books (and as Matlab and Octave work, in case you use these). No, you will not start by providing a complex input (like I imagined), because that’s what you want from the transform.

Please search the threads (it is very recent) and you will find it. It has a complete and working code, corrected by Robert Crovella and I think you will understand in a few minutes.

And you really have to spend time reading and re-reading the documentation.