I work on fluid-related simulations. I have used FFT for fluid simulation. I want to use discrete cosine transform (DCT) and discrete sine transform (DST) to transform my velocity field to wavenumbers.
I am using
RODFT00 as DCT and DST respectively (so the inverse are themselves).
I understand that the normalization is $2(n-1)$ and $2(n+1)$, respectively.
for DCT and DST, I take
$u(x) = \cos(3x); n=64$
But when I invert it, values after $(n/2)+1$ are all incorrect.
What is the right way to do?
UPDATE: I was using an old library which was heavily modified(FFT worked fine though). I used the original library and everything works fine. But now I have difficulty in using the library for my purposes(Don't know how to take care of the wavenumbers) which I have posted as a separate question. So I guess I don't need the answer. It was a defective library.