code: private static void convolve(double[] xreal, double[] ximag, double[] yreal, double[] yimag, double[] outreal, double[] outimag) {
  //        if (xreal.length != ximag.length || xreal.length != yreal.length || yreal.length != yimag.length || xreal.length != outreal.length || outreal.length != outimag.length)
  //            throw new IllegalArgumentException("Mismatched lengths");
  
          int n = xreal.length;
  
          FFT(xreal, ximag);
          FFT(yreal, yimag);
          for (int i = 0; i < n; i++) {
              double temp = xreal[i] * yreal[i] - ximag[i] * yimag[i];
              ximag[i] = ximag[i] * yreal[i] + xreal[i] * yimag[i];
              xreal[i] = temp;
          }
          inverseTransform(xreal, ximag);
  
          // Scaling (because this FFT implementation omits it)
          for (int i = 0; i < n; i++) {
              outreal[i] = xreal[i] / n;
              outimag[i] = ximag[i] / n;
          }
      }
docs: /*
  Computes the circular convolution of the given complex vectors. Each vector's length must be the same.