Optimal finite-difference operators for arbitrarily sampled data