## 4 Proposed Detection Method
### Sequential Detection Algorithm
\begin{split}\Omega_{f}(v)&=E_{X}\sum_{k\in \mathcal{P}}|C_{l}(k)|^{4}\Re\left\{\left[P_{i}^{s}(k)\right]^{2}\right\}\Re \left\{\left[P_{0}(k)\right]^{2}\right\}+\sum_{k\in\mathcal{P}}\Re\left\{\bar {W}_{l}(k)\right\}\Re\left\{\left[\bar{P}_{0}(k)\right]^{2}\right\}\\ &+\left|E_{X}\sum_{k\in\mathcal{P}}|C_{l}(k)|^{4}\Im\left\{\left[ P_{i}^{s}(k)\right]^{2}\right\}\Im\left\{\left[P_{0}(k)\right]^{2}\right\}+\sum_{k \in\mathcal{P}}\Im\left\{\bar{W}_{l}(k)\right\}\Im\left\{\left[\bar{P}_{0}(k) \right]^{2}\right\}\right|,\end{split}  \tag{23}\]  
where \(\bar{W}_{l}(k)=2|C_{l}(k+v-\epsilon)|^{2}S_{j}(k+v-\epsilon)P_{i}^{s}(k+v- \epsilon)e^{-jD_{l}\epsilon\rho}+[W_{l}(k)]^{2}\) and \(E_{X}\) denotes the symbol energy. It is worthy mentioning that \(\Omega_{f}(v)\) is independent of the transmitted PSSS and SSSS under hypothesis that the signal is synchronized. This observation means that the detection performance for the normal and extended CP modes is approximately the same under the assumption \(C_{l}(k)\approx C_{l+D_{l}}(k)\), which is valid for the situation where the mobility of the D2D UE is limited [30]. When the signal is not synchronized, i.e., \(v\
eq\epsilon\), it is obvious from (21) that \(\left[S_{j}(k+v-\epsilon)\right]^{2}\) becomes \(E_{X}\), while \(\left[P_{i}^{s}(k+v-\epsilon)P_{n}(k)\right]^{2}\) is a random sequence subject to the amount of \(\epsilon\). Under this hypothesis, \(\Omega_{f}(v)\) takes expression  
\[ \begin{split}\Omega_{f}(v)&=E_{X}\sum_{k\in\mathcal{P} }|C_{l}(k+v-\epsilon)|^{4}\Re\left\{\left[\bar{P}_{i}^{s}(k+v-\epsilon)\right]^ {2}\right\}\Re\left\{\left[\bar{P}_{0}(k)\right]^{2}\right\}+\sum_{k\in \mathcal{P}}\Re\left\{\bar{W}_{l}(k)\right\}\Re\left\{\left[\bar{P}_{0}(k) \right]^{2}\right\}\\ &+\left|E_{X}\sum_{k\in\mathcal{P}}|C_{l}(k+v-\epsilon)|^{4}\Im \left\{\left[P_{i}^{s}(k+v-\epsilon)\right]^{2}\right\}\Im\left\{\left[P_{0}( k)\right]^{2}\right\}+\sum_{k\in\mathcal{P}}\Im\left\{\bar{W}_{l}(k)\right\}\Im \left\{\left[P_{0}(k)\right]^{2}\right\}\right|.\end{split}  \tag{24}\]  
Due to the good autocorrelation and cross-correlation properties of \(P_{n}(k)\)'s [28], the central limit theorem (CLT) can be invoked such that (24) is regarded as a zero-mean Gaussian random variable (RV). Based on this observation, the IFO can be estimated as follows  
\[ \begin{split}\dot{\epsilon}=&\text{arg}\max_{v}\ \left|\Omega_{f}(v)\right|.\end{split}  \tag{25}\]  
After successful detection of the IFO, the SI has to be acquired, which can be performed by  
\[\Re\{\Omega_{s}(\dot{\epsilon},0)\}\underset{u_{1}}{\gtrless}\Re\{\Omega_{s} (\dot{\epsilon},1)\}. \tag{26}\]  
Using (20), (26) can be in an equivalent form  
\[ \begin{split}\dot{n}=1-u\left(\Re\{\Omega_{s}(\dot{\epsilon},0) \}-\Re\{\Omega_{s}(\dot{\epsilon},1)\}\right)\end{split}  \tag{27}\]  
where \(u(t)\) is the step function that takes \(u(t)=1\) for \(t>0\) and \(u(t)=0\) otherwise. Substituting (20) to (27), we have  
\[ \begin{split}\dot{n}=1-u\left(\sum_{k\in\mathcal{P}}\Im\left\{ \left[R_{l}(k+\dot{\epsilon})\right]^{2}\right\}\Im\left\{\left[\bar{P}_{0}(k) \right]^{2}\right\}\right),\end{split}  \tag{28}\]which can be implemented without additional computational operations because the enclosed quantity \(\sum_{k\in\mathcal{P}}\Im\left\{\left[R_{l}(k+\varepsilon)\right]^{2}\right\} \Im\left\{\left[\hat{P}_{0}(k)\right]^{2}\right\}\) is pre-calculated in (22). Once (25) and (27) have been completed, the SSSS is exploited to get the sidelink ID. Upon successful detection of the IFO and SI, the sidelink ID detection can be sequentially performed as [17]  
\[\hat{g}= \arg\max_{g}\left|\sum_{k\in\mathcal{P}}\frac{Y_{l+D_{l}}(k)S_{g}^{*}( k)}{\hat{H}_{l}(k)}\right| \tag{29}\]  
where \(\hat{H}_{l}(k)\) is the estimated channel from the PSSS symbol.