## 2 NB-IoT System Detailed Design and Implementation
### NPDSCH Receiver Chain Implementation  
#### 2.2.1 Coarse Synchronization  
The synchronization process is performed in both time and frequency by using the narrowband physical synchronization signal (NPSS). The first step of the synchronization procedure is coarse synchronization, which has simple computations and reduces the complexity of its following step, refined synchronization [5]. The coarse synchronization block makes use of the NPSS periodicity and the good correlation properties to estimate the time and frequency offsets with reasonable accuracy, frequency offset 50 Hz accuracy, and time offset 2 samples accuracy, performs CP removal and down-sampling after the synchronization process is terminated, and provides information about the symbol's position to facilitate the remaining chain's operations or serve the high layer requests. The synchronization procedure introduced in [20] is implemented in this work using the metric of reduction and normalization method presented in [21]. This implementation provides good performance at the minimum SNRs, in terms of speed and residual time and frequency errors, which are all investigated using an experimental FPGA-based hardware implementation method. As illustrated in Figure 7, the synchronization procedure consists of three steps, where the green color for the timing stages and the off-white color for the correlation (auto or cross) stages. The first step is to use a reduced averaged time domain auto-correlation metric to acquire a coarse timing by detecting the NPSS and a fractional frequency offset (FFO) estimate, leveraging the repetitive nature of the NPSS. This auto-correlation metric originally has one frame of 19,200 samples length, but it is reduced by a factor of 16 to decrease the memory requirements. Since the detection process has low resolution at low SNRs, it is averaged over frames to reduce the impact of the additive white Gaussian noise (AWGN). The metric is stored and when the maximum exceeds a certain  
Figure 6: IFFT detailed block diagram. threshold; it is considered a possible solution, and it is tested throughout the following procedure's step. The second step is to refine the timing estimate and to estimate the integer frequency offset (IFO) using a time domain cross-correlation metric. The auto-correlation peak is considered false if the maximum does not overtake another certain threshold and therefore the procedure goes back to the first step. Otherwise, it continues to step three. The third and last step implements the same metric of the second step multiple times on a local time-frequency grid to refine the timing and frequency estimates [20]. The data flow through the states can be defined as follows:  
* The time domain samples are stored in a buffer that has the size of one NPSS symbol to implement the lag and the multiplication operation in (18); hence each input sample will be multiplied with the conjugate of the oldest sample stored in the buffer. \[R(k)=\sum_{i=k}^{k+\frac{N_{\mathrm{g}}-1}{2}}\Big{(}r(i)\ \bullet\ S\Big{(}mod\Big{(}\sfrac{i}{N_{\mathrm{s}}}\ \,\ \ 11 \Big{)}\Big{)}\Big{)}\ \bullet\ \ \Big{(}r(i+N_{\mathrm{s}})\ \bullet\ S\Big{(}mod\Big{(}\sfrac{i}{N_{ \mathrm{s}}}+1,\ \ 11\Big{)}\Big{)}\Big{)}^{*}\] (18) where \(R(k)\) is the auto-correlation metric calculated in a single frame for a sample with index, \(k=1,2,\ldots\), 19,199, and \(N_{\mathrm{g}}\) represent the auto-correlation window and are equal to 1370, which is the length of 10 symbols and each has the length of \(N_{\mathrm{s}}=137\) samples. \(r\) is the received signal given by (19), and \(S\) refers to the code cover defined in [9; 20]. \[r(n)=[x(n)*h(n)]\ \ \ \cdot\ \ e^{-j\frac{2\pi n}{N}}+w(n),\ \ \ \epsilon= \epsilon_{i}+\epsilon_{f}\] (19) where \(x(n)\) is the transmitted baseband OFDM signal, \(h(n)\) is the impulse response of the multipath channel, and \(w(n)\) represents the AWGN.