numerical smoothing and differentiation