Some function much like this is necessary for any data channel since transmitting data requires bit level synchronization. For data synchronization there is the additional conundrum of the receiver knowing that now is the time to synchronize, and the transmitter problem of knowing that the receiver needs to synchronize. We ignore those problems here.

GPS is fundamentally a time transmitting application. The transmitted data are largely in support of synchronization.

A transmit power limit is not the same as a transmit energy limit. Perhaps a powerful spike would achieve synchronization, violate a power limit yet conform to an energy limit. I would like to know.

Sending a single spike, whose repetition would conform to the power (signal strength) limit, would be unrecognizable at the receiver since frequent noise spikes would exceed it. Sending a train of equally spaced spikes can conform to the power limit but the receiver will be unable to discriminate between these spikes and the spike interval exceeds the desired synchronization error.

Sending a random pattern of D 0’s and 1’s known to the receiver may do the trick using correlation at the receiver. This also provides selective access. A passive attack is thwarted if the pattern is otherwise unknown, but interception of many transmissions may reveal the secret. For this sort of security the pattern must be changed each time. See garage.

There is a terminology problem—perhaps it more accurate to say that this code, so far, assumes bit level synchronization and attempts to identify the bit. I.e. we deal for now only in integer values of the subscripts.

For independent random variables, the variance of the sum is the sum of the variances.
When the clocks are not synchronized (j≠k) S_{j} and S_{k} are independent.
Let V_{n} = Σ[0≤j<D]R_{n+j}S_{j} be the correlation of R_{n} with S_{n}.
In the following the expectation operator E is over the space of possible noises, not the space of possible signals.
Indeed we have postulated no distribution over the possible signals we might use.
Note that E(N_{n+j}S_{j}) = 0.

E(V_{n}) = E(Σ[0≤j<D]R_{n+j}S_{j})

= Σ[0≤j<D]E(R_{n+j}S_{j})

= Σ[0≤j<D]E((s∙S_{n+j} + N_{n+j})S_{j})

= Σ[0≤j<D]E(s∙S_{n+j}S_{j} + N_{n+j}S_{j})

= Σ[0≤j<D](s∙E(S_{n+j}S_{j}) + E(N_{n+j}S_{j}))

= Σ[0≤j<D](s∙E(S_{n+j}S_{j}))

= s∙Σ[0≤j<D]E(S_{n+j}S_{j})

E(S_{n+j}S_{j}) = S_{n+j}S_{j} since S does not depend on the noise and thus

E(V_{n}) = s∙Σ[0≤j<D](S_{n+j}S_{j}) = s∙C_{j}

where C_{j} = Σ[0≤j<D](S_{n+j}S_{j}).

E(V_{0}) = D∙s and for n≠0 E(V_{n}) = s∙Σ[0≤j<D](S_{n+j}S_{j}) is determined by our choice of signal.
I think that we can do better than random, even though most synthetic choices are worse than random.
I would guess that choosing S_{k} to minimize max[n≠0]C_{n} would be optimal because the threshold test looks for the maximum value of V_{j}.

Averaged over possible choices of signal, E(V_{n}) = 0 for n≠0, but E(max[n≠0]C_{n}) is much greater.

C_{0} = D and C_{j} = 0 for |j|>D.
C is small for most randomly chosen signals but not for periodic signals.

Choosing S to minimize max[n≠0]C_{n} is a curious problem.

Plan: Do long overlapping correlations on the input with pattern. Size of overlap is length of pattern. We copy code from Fast Fourier Transform (fft); and random normal deviate.

Here is the code.
We assume a shared secret noise burst `sk` of length `D`.
We consider `rp` time intervals each of length CS beginning at multiples of CS−D.
CS is a power of 2.
The noise plus signal therein is `R[i]` with 0≤i<rp*(CS−D)+D.
We place the signal beginning at `ro` which is a number we know but the receive code tries to discover (note restricted scope of `ro`).
`P` is the signal strength which is less than the noise level which is 1.