how to extract a period of a periodic pulsed signal?

I rercorded a sequence of zeros and ones which is repeated many times. However, the first and the last repetitions may not be complete because I have to start recording at a random time, so the sequence can be started when I hit record and the sequence may have not finished when I stop recording.

I'd like to know how to extract, for instance, the 3rd period of the complete recording, because this is something I know it would have the complete sequence.

here is a example of the signal I'm working with. I computed the FFT and I think the frequency is 96000Hz (half of the sampling rate), but still I'm not sure how to extract a complete period from it.

How could I do this?

Natalia Molinero Mingorance, Welcome to the DSP community.

What you have is basically a shifted periodic signal.
Why? Because what you have is equivalent (Given many samples) of having a periodic signal which you started sampling at $0$ and then we shit it to the real place you started sampling it.

Yea, there is the edge case, since it might not have its end and beginning to make a complete cycle.

But let's assume our model is perfect, what would you see in Frequency Domain (DFT)?

Well, since shifting in time only changes the phase it means you won't see any difference.

So how would you extract the period of a signal you started sampling at the beginning of a period in the Frequency Domain?
Yep, just looking at the Frequency in the Frequency Domain.

If you post the files of the samples we'll be able to to see this together.

• thanks @Royi, I uploaded a file with the recorded signal. I also computed the DFT in Matlab and, considering the sampling frequency is 192000Hz, the frequency is 96000Hz (half). Thank you!! – Natalia Molinero Mingorance Aug 27 '18 at 14:29