float[] input = new float[length * 2];
for (int i = 0; i < 2 * length; i++) {
input[i] = (float) data[i];
}
FloatFFT_1D fftlib = new FloatFFT_1D(length);
fftlib.complexForward(input);
// int multiplier = (int) (BASE_FREQUENCY / ((float) SAMPLE_RATE / (float) FFT_SIZE));
float outputData[] = new float[(input.length + 1) / 2];
for (int i = 0; i < length / 2; i++) {
outputData[i] = (float) Math.sqrt((Math.pow(input[2 * i], 2)) + (Math.pow(input[2 * i + 1], 2)));