## 3 Time-Gated SPAD Optimization Technology  
### BER of Time-Gated SPAD  
This section mainly studies the communication performance of time-gated AQ-SPAD. In the transmitting end, ON-OFF keying (OOK) modulation is often considered a reference modulation scheme for evaluating BER performance [24]. In the OOK modulation scheme, the optical signal has only two intensity levels. During each symbol time, the count of the SPAD array is required to determine \"0\" and \"1\" signals. The BER of the SPAD receiver consists of the probability that the \"0\" error is transmitted to \"1\" and the \"1\" error is transmitted to \"0\". If the \"0\" and \"1\" signals of the transmitting end have the same probability, the minimum BER can be obtained by intending the intersection of the probability density function of the \"0\" and \"1\" signals as the decision threshold. The probability density function of \"0\" and \"1\" signals can be expressed as:  
\[ \begin{split} P_{r1}&\sim N\big{(}u_{1}(\lambda_{1},\mathbf{T_{bg}}),\sigma_{1}^{2}(\lambda_{1},\mathbf{T_{bg}})\big{)},\\ P_{r0}&\sim N\big{(}u_{0}(\lambda_{0},\mathbf{T^{ \prime}_{bg}}),\sigma_{0}^{2}(\lambda_{0},\mathbf{T^{\prime}_{bg}})\big{)}. \end{split}  \tag{13}\]  
Among them, \(\mu_{1},\sigma_{1},\sigma_{0}\), \(\mu_{0}\) represent the mean and variance of photon count of \"1\" signal and \"0\" signal, respectively. \(\mathbf{T_{bg}}\) and \(\mathbf{T^{\prime}_{bg}}\) represent the blocking time variables caused by \"1\" signal and \"0\" signals, respectively, \(\mu_{1}\) and \(\mu_{0}\) can be calculated by Equation (6), \(\sigma_{1}\) and \(\sigma_{0}\) can be calculated by Equation (7). The photon flux of the \"0\" signal can be calculated by the background light power, which can be expressed as:  
\[\lambda_{0}=\frac{RP_{b}PDE}{N_{g}hv}, \tag{14}\]  
The photon flux of the \"1\" signal is determined by the background light power and signal light power, which can be calculated:  
\[\lambda_{1}=\frac{R(P_{b}+P_{r})PDE}{N_{g}hv}. \tag{15}\]  
where \(R\) is the responsivity, and the unit is \(A/W\), \(P_{r}\) is signal light power, \(P_{b}\) is the background light power, \(PDE\) is the detection efficiency, \(N_{g}\) is the number of pixels of the SPAD array, \(h\) is the Planck constant, \(v\) is the frequency of light signal, and \(hv\) usually represents photon energy. According to the maximum likelihood criterion, the optimal decision threshold for the time-gated SPAD receiver can be calculated as [25]:  
Figure 3: The influence of gate-ON time on the photon detection probability and variance. \[N_{th}=\frac{\frac{\mu_{0}}{\sigma_{0}^{2}}-\frac{\mu_{1}}{\sigma_{1}^{2}}+\sqrt{ \left(\frac{\mu_{0}}{\sigma_{0}^{2}}-\frac{\mu_{1}}{\sigma_{1}^{2}}\right)^{2}- \left(\frac{1}{\sigma_{0}^{2}}-\frac{1}{\sigma_{1}^{2}}\right)\left[\left(\frac{ \mu_{0}^{2}}{\sigma_{0}^{2}}-\frac{\mu_{1}^{2}}{\sigma_{1}^{2}}\right)+2\ln \frac{\sigma_{0}}{\sigma_{1}}\right]}}{\frac{1}{\sigma_{0}^{2}}-\frac{1}{ \sigma_{1}^{2}}}. \tag{16}\]  
Simplify Equation (16) and extract the main terms. The optimal decision threshold can be approximately calculated as:  
\[N_{th}=\frac{\mu_{1}(\lambda_{1},\mathbf{T_{Bg}})\sigma_{0}(\lambda_{0}, \mathbf{T_{Bg}})+\mu_{0}(\lambda_{0},\mathbf{T_{Bg}})\sigma_{1}(\lambda_{1}, \mathbf{T_{Bg}})}{\sigma_{0}(\lambda_{0},\mathbf{T_{Bg}})+\sigma_{1}(\lambda_ {1},\mathbf{T_{Bg}})}, \tag{17}\]  
where, \(\mu_{1}\), \(\mu_{0}\), \(\sigma_{1}^{2}\), \(\sigma_{0}^{2}\) represent the mean and variance of the \"1\" signal and \"0\" signal, respectively, which is the basis for selecting the appropriate decision threshold. In addition, considering ISI distortion, the decision threshold will be affected by the random vectors \(\mathbf{T_{Bg}}\). The optimal decision threshold is usually not an integer and must be determined according to the rounded result. When transmitting the OOK signal, it is necessary to compare the photon count with the decision threshold \(N_{th}\)[3]. When sending the \"1\" signal, the photon count is compared with the threshold value.