How much resolution do you need for the phase measurement? If a pulse is missing or an extra pulse occurs, are tehy of the same duration as the valid pulses or can they be shorter or longer? How much noise, ringing, or overshoot occurs on the pulse signals? What is the rise time of the pulses (and fall time if not symmetric)?
After the 40 pulses occur, how much time elapses before the next batch? Is there any kind of trigger signal available?
Answers to these will determine the minimum sampling rate required and will constrain the amount and type of processing necessary to make the measurements you need. It could be fairly straightforward. or it could be quite complicated.
Lynn