Since you have real data, you must pass these values ββto the realForward function, as indicated here . When you pass an array of values ββto this function, it returns results by overwriting that array using FFT coefficients.
array = new double[arraySize]; ... DoubleFFT_1D dfft = new DoubleFFT_1D(arraySize); dfft.realForward(array);
You should also consider the fact that the output contains both real and imaginary parts:
if arraySize even then
array[2*k] = Re[k], 0 <= k < arraySize/2 array[2*k+1] = Im[k], 0 < k < arraySize/2 array[1] = Re[arraySize/2]
if arraySize is odd then
array[2*k] = Re[k], 0 <= k < (arraySize+1)/2 array[2*k+1] = Im[k], 0 < k < (arraySize-1)/2 array[1] = Im[(arraySize-1)/2]
source share