// while(approxLength <= data.length/2) {
double[] approximation = new double[approxLength];
System.arraycopy(data, 0, approximation, 0, approxLength);
double[] extendedApproximation = new Extensioner(approximation)
.schedule(new CopyElementToBegin(0))
.schedule(new AddLastToEnd())
.execute();
extendedApproximation = sampler.upsample(extendedApproximation);
extendedApproximation = MathUtils.convolve(extendedApproximation, lowReconstructionFilter.getCoeff());
extendedApproximation = windower.window(extendedApproximation, 2, approximation.length * 2 + 2);
double[] details = new double[approxLength]; //must have same length with approximation
System.arraycopy(data, approxLength, details, 0, approxLength);
double[] extendedDetails = new Extensioner(details)
.schedule(new CopyElementToBegin(1))
.schedule(new AddLastToEnd())
.execute();
extendedDetails = sampler.upsample(extendedDetails);