## 2 Materials and Methods
### System Design
Thus, the channel DC gain from \(i\)-th LED to \(k\)-th user can be obtained from the following formula:  
\[H_{i,k}=\frac{(m_{l}+1)A_{r}g_{f}g_{c}h^{m_{l}+1}}{2\pi}\frac{1}{D_{i,k}^{m_{l} +3}}, \tag{6}\]  
where \(m_{l}\) is Lambertian order, \(A_{r}\) is the effective receiving area of PD, \(g_{f}\) is the gain of an optical filter, \(g_{c}\) is the gain of an optical concentrator, and \(h\) and \(D_{i,k}\) are the vertical distance and Euclidean distance between \(i\)-th LED and \(k\)-th user, respectively. We assumed that the VLCP system is perfectly synchronized. Thus, after removing the DC component, the received VLCP signal of \(k\)-th user can be expressed as:  
\[R_{i,k}(t)=\gamma H_{i,k}P_{t}aS_{i}(t)+N_{\text{AWGN}}(t), \tag{7}\]  
where \(\gamma\) is the PD responsivity and \(N_{\text{AWGN}}\) is the additive white Gaussian noise (AWGN), including shot noise \(N_{shot}\) and thermal noise \(N_{thermal}\), which are described as:  
\[ \begin{split}& N_{shot}=2q\Big{[}\gamma P_{t}H_{i,k}+I_{bg}I_{2} \Big{]}B\\ & N_{thermal}=8\pi kT_{k}\gamma H_{r}B^{2}\Big{(}\frac{I_{2}}{G}+ \frac{2\pi\Gamma}{g_{m}}\eta A_{r}I_{3}B\Big{)}\end{split} . \tag{8}\]  
Here, \(q\) is the electronic charge, \(I_{bg}\) is the background current; \(I_{2}\) is noise bandwidth factor; \(B\) is the equivalent noise bandwidth, which is equal to the system modulation bandwidth; \(k\) denotes the Boltzmann constant; \(T_{k}\) is absolute temperature; \(\eta\) is fixed capacitance of photodetector per unit area; \(G\) is open loop voltage gain; \(\Gamma\) is FET channel noise factor; \(g_{m}\) is FET transconductance; and \(I_{3}\) is gate-induced drain leakage. For the \(k\)-th user, \(c_{k}\) can be used to decode the received VLCP signal \(R_{i,k}\). Then, the normalized correlation value between \(n\)-th encoded symbol and \(c_{k}\) can be expressed as:  
\[ \begin{split}\xi_{i,k,n}&=\frac{1}{L}\sum\limits_{ l=0}^{L-1}R_{i,k,n}(l)c_{k}(l)\\ &=\gamma H_{i,k}P_{t}\alpha\beta\frac{1}{L}\sum\limits_{l=0}^{L-1 }\sum\limits_{m}^{N}u_{m,n}(l)c_{m}(l)c_{k}(l)+N_{\text{noise}}\end{split} , \tag{9}\]  
where \(N_{\text{noise}}=(1/L)\Sigma c_{k}\times N_{\text{AWGN}}\) is the AWGN spread by \(c_{k}\). Given the orthogonality of Walsh-Hadamard code, the correlation between different codes should be zero, which means:  
\[\sum\limits_{l=0}^{L-1}c_{m}(l)c_{k}(l)= \begin{cases}L&m=k\\ 0&m\
eq k\end{cases}  \tag{10}\]  
Therefore, Equation (9) can be rewritten as:  
\[\xi_{i,k,n}=\gamma H_{i,k}P_{t}\alpha\beta u_{k,n}+N_{\text{noise}} \tag{11}\]  
For VLC, by comparing the correlation value obtained from Equation (11) with threshold value \(\lambda\), the \(n\)-th symbol of \(k\)-th user data can be recovered from:  
\[v_{k,n}= \begin{cases}1,&\xi_{i,k,n}>\lambda\\ -1,&\xi_{i,k,n}<\lambda\end{cases} . \tag{12}\]  
For VLP, the RSS from \(i\)-th LED to \(k\)-th user can be calculated according to correlation value:  
\[\Re_{i,k,n}=\left|\xi_{i,k,n}\right|=\gamma H_{i,k}P_{t}\alpha\beta+N_{\text {noise}}. \tag{13}\]Then, by substituting Equation (6) into Equation (13), the estimated distance between \(i\)-th LED and \(k\)-th user can be obtained from:  
\[ \begin{split}&\widetilde{D}_{i,k}=\varsigma(\Re_{i,k,n}-N_{\text{noise}})^{- [1/\,(m_{l}+3)]},\\ &\text{where }\varsigma=\left(\frac{(m_{l}+1)A_{i}g_{f}g_{c}h^{m_{ \dagger}+1}}{2\pi}\gamma\alpha\beta P_{t}\right)^{[1/(m_{l}+3)]}.\end{split}  \tag{14}\]  
For a specific system, the parameter \(\varsigma\) is constant. After gaining the distances between all LEDs and \(k\)-th user, the position of \(k\)-th user can be located through the trilateration algorithm from [26]:  
\[AE=B\]  
\[\text{where }A= \begin{bmatrix}X_{2}-X_{1}&Y_{2}-Y_{1}\\ \vdots&\vdots\\ X_{i}-X_{1}&Y_{i}-Y_{1}\end{bmatrix} ,E= \begin{bmatrix}x_{k}\\ y_{k}\end{bmatrix} ,\text{ and }B=\frac{1}{2} \begin{bmatrix}X_{2}^{2}+Y_{2}^{2}-(X_{1}^{2}+Y_{1}^{2})+ \widetilde{D}_{1,k}^{2}-\widetilde{D}_{2,k}^{2}\\ \vdots\\ X_{i}^{2}+Y_{i}^{2}-(X_{1}^{2}+Y_{1}^{2})+\widetilde{D}_{1,k}^{2}-\widetilde{D }_{i,k}^{2}\end{bmatrix} .