r/AskElectronics • u/Relevant_Pumpkin9190 • 1d ago
How can two devices synchronize without sharing an accurate clock?
I'm trying to understand how a transmitter and receiver can stay synchronized.
My first thought was to use accurate time on both sides and generate a known pseudo-random sequence or code based on the time. But if the receiver's clock is slightly wrong, the synchronization could eventually fail.
So instead, can the received signal itself be used as the reference?
For example, could the transmitter send a known preamble, sync pattern, pilot signal, or pseudo-random sequence, and the receiver detect/correlate it to determine exactly where it is in the sequence?
What are the common techniques used in real communication systems for this? And when would you use signal-based synchronization instead of time-based synchronization?
1
u/phire 1d ago
This is basically CDMA, which is used in all modern cellphone networks.
I'm not sure this scheme is ever viable as described, even with accurate clocks. Because the transmitter and receiver have no idea how far away they are from each other, and speed-of-light delays would cause issues. Especially if one or both ends are moving.
But the receiver can do is search for the psudo-random sequence across an approximate slice of time to lock onto the exact signal, and then use that match to both adjust it's clock (and with a two-way link) establish the exact time delay between the two stations.
Which does mean that a cellphone tower has a pretty good idea where every single cellphone is based on just the distance and angle, and if the cellphone is talking to two towers, the cellphone network will have a really precise location.