Outputs to the file are all zeros.
I am made fraught by the following code, which generates output values:
for (int i = 0; i < peaks3.length; i++) {
if (peaks3[i] < 4) {
peaks3[i] = 0;
} else {
peaks3[i] = 1;
}
}
What happens if a value of peaks3[something] is less than zero? I mean, since your few example points had values less than zero, well...
One suggestion:
Put in print statements before and after that loop to see whether negative values are being reduced to zero. (If they are, and you don't want them to be, then you can fix it, right?)
Another suggestion:
Just for test purposes, maybe you can just comment out all of that limit loop and look at the values in the output file. Maybe the threshold needs to be changed.
A couple of questions:
Where did you get the value 4 as the threshold?
What is the nature of the data set that leads you to believe that is appropriate?
What do you expect the output to be? Surely you have a test case for which you know the correct answer, right? Where did the test case come from? Maybe you can get some test data from whoever implemented the fft/ifft stuff. I mean, that part has been tested, right?
Cheers!
Z