I have an array of audio data I am passing to a reader:
recorder.read(audioData,0,bufferSize);
The instantiation is as follows:
Assuming the audioData
array contains the raw audio data, you need to create a Complex[]
object from the audioData
array as such:
Complex[] complexData = new Complex[audioData.length];
for (int i = 0; i < complexData.length; i++) {
complextData[i] = new Complex(audioData[i], 0);
}
Now you can pass your complexData
object as a parameter to your FFT function:
Complex[] fftResult = FFT.fft(complexData);