Event Detection for Active Lower Limb Prosthesis