@Override
  public void terminate(PointCollector collector) throws Exception {
    int n = valueList.size();
    DoubleFFT_1D fft = new DoubleFFT_1D(n);
    // each data point count for 2 double values, same with UDTFFFT
    double[] a = new double[2 * n];
    for (int i = 0; i < n; i++) {
      a[2 * i] = valueList.get(i);
      a[2 * i + 1] = 0;
    }
    fft.complexForward(a);
    // remove low frequency components
    int m = (int) Math.floor(wpass * n / 2);
    for (int i = 0; i <= 2 * m + 1; i++) {
      a[i] = 0;
    }
    for (int i = 2 * (n - m); i < 2 * n; i++) {
      a[i] = 0;
    }
    fft.complexInverse(a, true);
    // output
    for (int i = 0; i < n; i++) {
      collector.putDouble(timeList.get(i), a[i * 2]);
    }
  }
This function filters high frequency components.
library-udf/src/main/java/org/apache/iotdb/library/frequency/UDTFHighPass.java