jtransforms problem

Can somebody help me with that. I am using an fft library jtransforms. When I apply the fft to an array:

 double[][] array = new double[][] {{1,1,1,1},{1,1,1,1}};
DoubleFFT_2D fft = new DoubleFFT_2D(2,2);

Then I am getting the following results:
[4.0, 0.0, 0.0, -1.0]
[0.0, 0.0, 0.0, 0.0]

In the api http://incanter.org/docs/parallelcolt/api/edu/emory/mathcs/jtransforms/fft/DoubleFFT_2D.html#realForwardFull(double[][]) it says that "To get back the original data, use complexInverse on the output of this method."

so I am doing:
fft.complexInverse(array, false);
and I am getting:
[4.0, -1.0, 4.0, 1.0]
[4.0, -1.0, 4.0, 1.0]

where I want to get back to the original data which is only 1's.

Who is Participating?
objectsConnect With a Mentor Commented:
check your data matches this from the javadoc:

"Because the result is stored in a, the input array must be of size rows by 2*columns, with only the first rows by columns elements filled with real data."
Thats weird. Poor documentation though, makes it hard to work out whats going on
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.