Ejemplo n.º 1
0
 public static float[] ps1ToPpTime(Sampling sf, float[] u1, Sampling sg, float[] g) {
   int n1 = u1.length;
   int ng = g.length;
   float[] xg = new float[ng];
   for (int ig = 0; ig < ng; ig++) xg[ig] = (float) sg.getValue(ig);
   CubicInterpolator ci = new CubicInterpolator(Method.LINEAR, xg, g);
   float[] gp = new float[n1];
   for (int i1 = 0; i1 < n1; i1++) gp[i1] = ci.interpolate((float) (sf.getValue(i1) + u1[i1]));
   return gp;
 }
Ejemplo n.º 2
0
 /**
  * Scale shifts by compression factor c.
  *
  * @param sf the trace sampling corresponding to shifts.
  * @param u array of shifts to compress.
  * @param c scale factor. To stretch, c, to compress, 1/c.
  * @return scaled shifts.
  */
 public static float[] getScaledShifts(Sampling sf, float[] u, float c) {
   int n = u.length;
   float[] uc = new float[n];
   for (int i = 0; i < n; i++) {
     float fv = (float) sf.getValue(i);
     uc[i] = (fv + u[i]) * c - fv;
   }
   return uc;
 }