TransformForward( double[] samples, out double[] fftReal, out double[] fftImag, params int[] dimensionLengths ) { for (int i = 0; i < dimensionLengths.Length; i++) { if (Fn.CeilingToPowerOf2(dimensionLengths[i]) != dimensionLengths[i]) { throw new ArgumentException(Resources.ArgumentPowerOfTwoEveryDimension, "dimensionLengths"); } } // TODO: Implement real version (at the moment this is just a wrapper to the complex version)! double[] samplePairs = new double[samples.Length << 1]; for (int i = 0, j = 0; i < samples.Length; i++, j += 2) { samplePairs[j] = samples[i]; } _fft.DiscreteFourierTransformMultiDim(samplePairs, dimensionLengths, true, _convention); fftReal = new double[samples.Length]; fftImag = new double[samples.Length]; for (int i = 0, j = 0; i < samples.Length; i++, j += 2) { fftReal[i] = samplePairs[j]; fftImag[i] = samplePairs[j + 1]; } }
TransformForward( double[] samplePairs, params int[] dimensionLengths ) { for (int i = 0; i < dimensionLengths.Length; i++) { if (Fn.CeilingToPowerOf2(dimensionLengths[i]) != dimensionLengths[i]) { throw new ArgumentException(Resources.ArgumentPowerOfTwoEveryDimension, "dimensionLengths"); } } _fft.DiscreteFourierTransformMultiDim(samplePairs, dimensionLengths, true, _convention); }