void forward(int n) {
    if (n < ncof) {
      return;
    }

    if (n > workspace.length) {
      workspace = new double[n];
    } else {
      Arrays.fill(workspace, 0, n, 0.0);
    }

    int nmod = ncof * n;
    int n1 = n - 1;
    int nh = n >> 1;

    for (int ii = 0, i = 0; i < n; i += 2, ii++) {
      int ni = i + 1 + nmod + ioff;
      int nj = i + 1 + nmod + joff;
      for (int k = 0; k < ncof; k++) {
        int jf = n1 & (ni + k);
        int jr = n1 & (nj + k);
        workspace[ii] += cc[k] * data[jf];
        workspace[ii + nh] += cr[k] * data[jr];
      }
    }

    System.arraycopy(workspace, 0, data, 0, n);
  }
Applies the wavelet filter to a signal vector a[0, n-1].

@param n the length of vector.
library-udf/src/main/java/org/apache/iotdb/library/frequency/util/DWTUtil.java