/** * Applies the shifts {@code u} to the trace {@code g}. * * @param sf the sampling that {@code g} is being warped to. * @param u the shifts to apply to {@code g}. * @param sg the sampling of {@code g}. * @param g the trace to be warped. * @return the warped trace. */ public static float[] applyShifts(Sampling sf, final float[] u, Sampling sg, final float[] g) { final int n1 = u.length; final int ng = g.length; final double dg = sg.getDelta(); final double df = sf.getDelta(); final double fg = sg.getDelta(); final double ff = sf.getDelta(); final float[] hf = new float[n1]; final SincInterp si = new SincInterp(); double v = ff; for (int i1 = 0; i1 < n1; i1++, v = ff + i1 * df) hf[i1] = si.interpolate(ng, dg, fg, g, (float) v + u[i1]); return hf; }
public static void scale(SincInterp si, int n1, float[] f, float c, float[] g) { si.interpolate(n1, 1.0, 0.0, f, n1, c, 0.0, g); copy(g, f); }