Say that I have a digital signal (a bitstream actually) whose output changes every 100 mS. I don't know exactly when it changes relative to my sampling, only that that the next bit to capture appears after 100 mS. (I'm not capturing a square wave, but rather the signal might or might not assume a new value (either 1 or 0) after 100 mS.) So I sample the signal every 25 mS. How do I reproduce the bitstream from the sampled stream over some period of time...I can miss the first few bits of the capture, but after that I want to get every bit of the output? I assume that there is a common algorithm for doing this.
By the way, the solution can all be done in software (Java / C++) and does not have to be real time...I can collect all samples and then post-process it to extract the signal.