@Override
  public void validate(UDFParameterValidator validator) throws Exception {
    validator
        .validateInputSeriesNumber(1)
        .validateInputSeriesDataType(0, Type.DOUBLE, Type.FLOAT, Type.INT32, Type.INT64)
        .validate(
            x ->
                ((String) x).equalsIgnoreCase("uniform")
                    || ((String) x).equalsIgnoreCase("nonuniform"),
            "Type should be 'uniform' or 'nonuniform'.",
            validator.getParameters().getStringOrDefault("method", "uniform"))
        .validate(
            x ->
                "real".equalsIgnoreCase((String) x)
                    || "imag".equalsIgnoreCase((String) x)
                    || "abs".equalsIgnoreCase((String) x)
                    || "angle".equalsIgnoreCase((String) x),
            "Result should be 'real', 'imag', 'abs' or 'angle'.",
            validator.getParameters().getStringOrDefault("result", "abs"))
        .validate(
            x -> (double) x > 0 && (double) x <= 1,
            "Compress should be within (0,1].",
            validator.getParameters().getDoubleOrDefault(COMPRESS_PARAM, 1));
  }
This function does Fast Fourier Transform for input series.
library-udf/src/main/java/org/apache/iotdb/library/frequency/UDTFFFT.java