Movement extraction by detecting dynamics switches and repetitions