Interpolation and differentiation for periodic functions