transform method

void transform (Float64List real, Float64List imag)

Computes the discrete FFT of a complex array in place. real = the real values of the array imag = the imaginary values of the array. Throws if real and imag have different lengths, and if the length is not a power of 2. The result is again complex, and is contained in the original array. The resulting array values are scaled relatively (non absolute values).

Implementation

static void transform(Float64List real, Float64List imag) {
  if (real.length != imag.length) throw "Mismatched lengths";
  int n = real.length;
  if (n == 0) {
    return;
  } else if ((n & (n - 1)) == 0) {
    // Is power of 2
    transformRadix2(real, imag);
  } else {
    throw "array size is not a power of 2!";
  }
}