for (int i = 0; i < nSamples; i++) {
samples[i] = (double)data[i];
}
FFT fft = new FFT(nSamples, window);
fft.transform(samples);
// Output the spectrum
double[] magnitude = fft.magnitudes();
final double stepHz = 2.0d * nSamples / (double)wave.sampleRate();