@Override
  public void terminate(PointCollector collector) throws Exception {
    int n = time.get(time.size() - 1) + 1;
    double[] a = new double[n * 2];
    for (int i = 0; i < time.size(); i++) {
      int k = time.get(i);
      a[k * 2] = real.get(i);
      a[k * 2 + 1] = imag.get(i);
      // conjugate
      if (k > 0) {
        k = n - k;
        a[k * 2] = real.get(i);
        a[k * 2 + 1] = -imag.get(i);
      }
    }
    DoubleFFT_1D fft = new DoubleFFT_1D(n);
    fft.complexInverse(a, true);
    for (int i = 0; i < n; i++) {
      collector.putDouble(start + i * interval, a[2 * i]);
    }
  }
This function does Inverse Fast Fourier Transform for input series.
library-udf/src/main/java/org/apache/iotdb/library/frequency/UDTFIFFT.java