docs: def Vaknin (x):
    """
    Vaknin correction for CSD analysis (Max Sherman [Brown U] implementation)
    Allows CSD to be performed on all N contacts instead of N-2 contacts
    See Vaknin et al (1989) for more details
    """
    # Preallocate array with 2 more rows than input array
    x_new = np.zeros((x.shape[0]+2, x.shape[1]))
    # print x_new.shape
    # Duplicate first and last row of x into first and last row of x_new
    x_new[0, :] = x[0, :]
    x_new[-1, :] = x[-1, :]
    # Duplicate all of x into middle rows of x_neww
    x_new[1:-1, :] = x
    return x_new