@Override
  public void terminate(PointCollector collector) throws Exception {
    double[] ans = new double[list1.size() + list2.size() - 1];
    for (int i = 0; i < list1.size(); i++) {
      for (int j = 0; j < list2.size(); j++) {
        ans[i + j] += list1.get(i) * list2.get(j);
      }
    }
    for (int i = 0; i < ans.length; i++) {
      collector.putDouble(i, ans[i]);
    }
  }
This function calculates convolution of two input series.
library-udf/src/main/java/org/apache/iotdb/library/frequency/UDTFConv.java