I've written some simple audio processing algorithms in MATLAB that I will be using for an Android application. I'm having some trouble translating the FFT implementation to Java.
I'm trying to use the Java version of fftpack, which is reportedly efficient, but is also a bit cryptic to me, perhaps because my lack of a firm grasp on FFT in general.
I simply have a double array from which I want to produce a corresponding array of Complex numbers representing the FFT. The only calculation I will be doing on the FFT is taking the absolute value of its elements.
For clarity's sake, here is the essential MATLAB code that I would like to replicate using Java fftpack:
X = fft(myDoubleArray);
abs(X[i]);
I expect this is rather simple, but I can't identify entry points into fftpack.
SOLVED:
The answer below from LutzL works, but creating a Complex1D object is actually unnecessary as fftpack supports a double array as input:
RealDoubleFFT rdfft = new RealDoubleFFT(myArray.length);
rdfft.ft(myArray);