# FPGA-Based Manchester Decoder for IEEE 802.15.7 Visible Light Communications
## 3 Evaluation of the Receiver Performance in Simulations  
### Evaluation of How the Saturation of \(z\) Affects the Receiver Performance  
In Section 2.3, when we discussed Equation (8), we mentioned the convenience to limit the value of \(z\) in order to reduce the possible jitter in phase jumps among subsequent bits. The value \(z\) in Equation (8) ranges in \(\pm N/2\), thus we can limit the 'jumps' to a percentage \(Z_{\%}\) of the maximum range \(N/2\) Formally:  
\[z=\begin{cases}sign(z)\cdot Z_{\%}N/2&|z|>Z_{\%}N/2\\ z&|z|\leq Z_{\%}N/2\end{cases} \tag{13}\]  
In this test we investigate how \(Z_{\%}\) affects the receive performance. The algorithm described so far was implemented in MATLAB R2024a (The Mathworks, Natick, MA, USA). In input to the receiver, a signal was prepared that included a synchronization sequence of 100 bit of zeros (01 symbols), followed by a payload of \(10^{6}\) bits generated randomly. At the very beginning of the sequence, a period of noise was added. It lasted for a random length between 0 and \(T_{b}\). The aim was generating an initial phase difference between the transmission and the reception timings. According to IEEE 802.15.7 standard, we simulated \(T_{b}=10\) us, corresponding to 100 kbit/s. The signal was sampled at \(f_{c}=10\) Msps, thus we had \(N=100\).  
The relatively long extent of the synchronization sequence used here was necessary to test low values of \(Z_{\%}\): in fact, with \(Z_{\%}=2\%\) the receiver can adjust for a maximum of one sample per bit, and thus, in the worst case, needs 100 bits to synchronize.  
A white noise was added to the signal to achieve a SNR ranging from 0 dB to \(-25\) dB, with a 1 dB step. The value of \(Z_{\%}\) evaluated were: 2%, 4%, 6%, 8%, 10%, 20%, and 100%. Parameters are summarized in Table 5. We performed 4 simulations for each couple of \(Z_{\%}\), SNR values, for a total of \(4\times 7\times 25=700\) simulations. The performance of the receiver was evaluated through the BER, calculated as the ratio between the number of the wrong received bits, and the number of bits in the payload (\(10^{6}\) in these experiments). In case of no error, the BER was considered \(1/10^{6}\).  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter** & **Value** \\ \hline Sync seq. & 100 bits \\ Payload & \(10^{6}\) bits \\ \(T_{b}\) & 10 μs \\ \(f_{c}\) & 10 Msps \\ N & 100 \\ SNR & 0; \(-25\) dB; step 1 dB \\ Z\% & 2\%, 4\%, 6\%, 8\%, 10\%, 20\%, 100\% \\ \hline \hline \end{tabular}
\end{table}
Table 5: Parameters employed in simulations.  
The BER resulting from the 4 simulations for each couple of \(Z_{\%}\) and SNR values were averaged and reported in Figure 5. The picture shows 7 curves in different colors: one for each value of \(Z_{\%}\) tested (see the legend). The curves represent the BERs over the simulated range of SNR. It is interesting noting that the receiver makes no error as long as the SNR is higher than about \(-3\) dB, and the output is only noise when SNR \(<-20\) dB, regardless of \(Z_{\%}\). For SNR between \(-3\) and \(-20\) dB \(Z_{\%}\) plays an important role, and in general the lower \(Z_{\%}\), the better. However, the results show a limit in the improvement of the BER with \(Z_{\%}\). For example, given an acceptable error rate of BER \(<10^{-4}\), we observe a gain in the performance when \(Z_{\%}\) decreases until 10%, but no gain for \(Z_{\%}<10\%\). Similarly, the lower limit of \(Z_{\%}\) to achieve an improvement in the performance is about \(Z_{\%}=6\%\) when we require BER \(<10^{-2}\); and so on.