static double[] shortToDoubleArray(short[] a, int start, int end) { double[] b = new[end-start]; for (int i = start; i < end; i++) b[i-start] = a[i]; ret b; }