# PRG: A Distance Measurement Algorithm Based on Phase Regeneration
## Principle of PRG
### Range Finding Signal Acquisition
#### 2.3.2 Signal Detection  
Signal acquisition is estimate the frequency of the receiving signal and then initialize the tracking loop according to these parameter to help the receiving channel to track the signal. Figure 3 illustrates a high level block diagram typical of signal acquisition where the digitized received RF signal is applied to the input. Referring to Figure 3, first the digital RF is stripped of the carrier by the replica carrier signals to produce in-phase (i) and quadraphase (q) sampled data and then the results i and q generate data to I and Q after the coherent integration with time \(T_{c}\). Finally, the incoherent integral amplitude  
Figure 2: Range finding signal modulation block diagram. is obtained by incoherent integration. The incoherent detection method of signal acquisition determines whether the received signal has been detected by detecting the magnitude of the incoherent integral amplitude \(V\): if the incoherent integral amplitude \(V\) is less than the acquisition threshold value \(V_{t}\), the signal has not been searched and the receiver adjusts the carrier numerical control oscillator according to the set search step and continues to search and detect signals in the next search cell. Otherwise, if \(V>V_{t}\), the signal is searched, and the receiver then confirms that the signal is successfully captured. The complex form of coherent integration is:  
\[r(n)=I(n)+jQ(n)=a\cdot\text{sinc}(f_{e}T_{c})\cos\phi_{e}+n_{I}+j[a\cdot\text{ sinc}(f_{e}T_{c})\sin\phi_{e}+n_{Q}]\]  
Where \(a\) is the amplitude of signal, \(f_{e}\) represents frequency difference between received carrier and replica carrier generated by NCO, \(\phi_{e}\) represents phase difference between 2 carriers, and \(n_{I}\sim N(0,\sigma_{n}^{2})\), \(n_{Q}\sim N(0,\sigma_{n}^{2})\), and \(n_{Q}\) and \(n_{I}\) is independent. The \(\sigma_{n}\) can be expressed by:  
\[\sigma_{n}=\frac{N_{0}}{T_{c}}\]  
Without noise, the amplitude of \(r(n)\) is:  
\[V=|r(n)|=\sqrt{I^{2}(n)+Q^{2}(n)}=a\cdot|sinc(f_{e}T_{c})|\]  
We can see phase difference \(\phi_{e}\) between receiving and replica carrier does not affect the value of \(V\), so the \(V\) can be used for capture detection. From the above assumption of \(n_{I}\) and \(n_{Q}\), the amplitude \(V\) have Ricean distributions in the presence signal and have Rayleigh distributions in absence of signals [11]. The Rayleigh distribution probability density function \(f_{n}(v)\) is shown in Equation (2) and the probability density function \(f_{s}(v)\) of Ricean distribution is shown in Equation (3), and its probability density curve is shown in Figure 4.  
\[f_{n}(v)=\frac{v}{\sigma_{n}^{2}}\exp^{-\frac{v^{2}}{2\sigma_{n}^{2}}} \tag{2}\]  
\[f_{s}(v)=\frac{v}{\sigma_{n}^{2}}\exp^{-\frac{v^{2}+q^{2}}{2\sigma_{n}^{2}}}I_ {0}(\frac{va}{\sigma_{n}^{2}}) \tag{3}\]  
Figure 3: Typical of signal acquisition block diagram. We can be seen from Figure 4, selecting the appropriate capture threshold value \(V_{t}\) is the key step for signal acquisition to achieve good performance. Too small threshold value can easily cause false alarm, and too high threshold value can easily cause leakage alarm. It is often necessary to set a false alarm rate \(P_{fa}\) of signal acquisition and then calculate the corresponding acquisition threshold value according to the false alarm rate. Moreover, signal acquisition sensitivity is also related to false alarm rate and leakage rate \(P_{md}\). we assume that the acquisition probability \(P_{d}=1-P_{md}=0.9\) and \(P_{fa}=10^{-3}\) can be able to capture normally and then the probability density formula is given:  
\[P_{fa}=\int\limits_{V_{t}}^{\infty}f_{n}(v)dv=\int\limits_{V_{t}}^{\infty} \frac{\
u}{\sigma_{n}^{2}}e^{-\frac{v^{2}}{2\sigma_{n}^{2}}}dv=e^{-\frac{V_{t} ^{2}}{2\sigma_{n}^{2}}} \tag{4}\]  
\[P_{d}=\int\limits_{V_{t}}^{\infty}f_{s}(v)dv= Q_{1}(\sqrt{\rho_{c}},\frac{V_{t}}{\sigma_{n}}) \tag{5}\]  
where \(\rho_{c}=2\frac{C}{N_{0}}T_{c}\) and \(Q_{1}(\cdot)\) is Marcum \(Q\)-Function.