def lag(x,y,samps):
    """
    Lag x samps to the left and
    lag y samps to the right.
    samps must be even.
    If samps is negative x shifted to the right and y to the left.
    This process truncates trace length by samps and preserves centrality.
    Therefore windowing must be used after this process 
    to ensure even trace lengths when measuring splitting.
    """
    if samps == 0:
        return x,y

    if samps > 0:
        # positive shift
        return x[samps:], y[:-samps]
    else:
        # negative shift
        return x[:samps], y[-samps:]