Fourier movement primitives: an approach for learning rhythmic robot skills from demonstrations