public DWTData getDR(double[] valuearray) { Transform t = new Transform(new AncientEgyptianDecomposition(new FastWaveletTransform(new Haar1()))); DWTData tsHilb = new DWTData(t.forward(valuearray)); // This calculates log_2(x). double resolution = Math.log(windowsize) / Math.log(2); for (int i = 0; i < resolution; i++) { tsHilb = removeHighestFrequency(tsHilb); } return tsHilb; }
/** * Here we use double array as the ouput data structure to store the DWT results in the Hilbert * Space. * * @param ts * @return a double array containing the DWT result in Hilbert Space. */ @Override public DWTData getDR(TimeSeries ts) { double tslength = Math.log(ts.size() / windowsize) / Math.log(2); // TODO reconstruct this to have a more flexible solution. if (tslength % 1 != 0) { logger.info("The input Time Series length does not match the windowsize"); // return null; } LinkedList<Double> tsvalues = DataListOperator.getInstance().getValueList(ts); double[] valuearray = DataListOperator.getInstance().linkedDoubleListToArray(tsvalues); return getDR(valuearray); }