Functional Principal Component Analysis for Recognition of Arm Gestures and Humanoid Imitation