The generation of trajectories for a biped robot is a problem which has been largely studied for several years, and many satisfying off-line solutions exist for steady-state walking in absence of disturbances. The question is a little more complex when the generation of the desired trajectories of joints or links has to be achieved or adapted online, i.e. in real time, for example when it is wished to strongly synchronize these trajectories with an external motion. This is precisely the problem addressed in this paper. Indeed, we consider the case where the "master" motion is measured by an position sensor embedded on a human leg. We propose a method to synchronize the motion of a robot or on other device with respect to the output signal of the sensor. The main goal is to estimate as accurately as possible the current phase along the gait cycle. We use for that purpose a model based on a nonlinear oscillator, to which we associate an observer. Introducing the sensor output in the observer allows us to compute the oscillator phase and to generate a synchronized multilinks trajectory, at a very low computational cost. The paper also presents evaluation results in terms of robustness against parameter estimation errors and velocity changes in the input.