## 2 Materials and Methods
### CSK Modulation
\tag{12}\]  
This also implies that the possible optical power values emitted by the LEDs are bounded by \(P_{\text{avg}}\), i.e.,  
\[0\leq P_{1,n}\leq P_{\text{avg}},\quad 0\leq P_{2,n}\leq P_{\text{avg}},\quad 0 \leq P_{3,n}\leq P_{\text{avg}},\quad\forall n=1,\ldots,M\,. \tag{13}\]  
Additionally, in all CSK constellations allowed by the IEEE 802.15.7 standard, the optical power transmitted by each LED averaged over all possible symbols is given by [27]  
\[\frac{1}{M}\sum_{n=1}^{M}P_{1,n}=\frac{1}{M}\sum_{n=1}^{M}P_{2,n}=\frac{1}{M} \sum_{n=1}^{M}P_{3,n}=\frac{P_{\text{avg}}}{3}\,. \tag{14}\]  
Given a CSK optical power signal \(\mathbf{x}(t)=[x_{1}(t),x_{2}(t),x_{3}(t)]^{\text{T}}\) (\(W\)) as input, where \(x_{1}(t)\), \(x_{2}(t)\), \(x_{3}(t)\) represent the instantaneous emitted power from the red, green, and blue LED, respectively, we can calculate the instantaneous photocurrent signal \(\mathbf{y}(t)=[y_{1}(t),y_{2}(t),y_{3}(t)]^{\text{T}}\) (A), where \(y_{1}(t)\), \(y_{2}(t)\), and \(y_{3}(t)\) represent the instantaneous photocurrent produced at the red, green, and blue PD, respectively, by  
\[y_{j}(t)=\sum_{i=1}^{3}h[i,j](t)*x_{i}(t)+n_{j}(t)\,,\quad i,j=1,2,3\,, \tag{15}\]where \(n_{j}(t)\) is the additive noise at the \(j\)th PD with noise variance \(\sigma_{j}^{2}\). The average optical power emitted by the \(i\)th LED, \(P_{\text{avg},\,i}\), is given by  
\[P_{\text{avg},\,i}=\lim_{T\to\infty}\frac{1}{2T}\int_{-T}^{T}x_{i}(t)\,dt\,. \tag{16}\]  
From Equation (14), it follows that  
\[P_{\text{avg},\,1}=P_{\text{avg},\,2}=P_{\text{avg},\,3}=\frac{P_{\text{avg}} }{3}\,, \tag{17}\]  
where \(P_{\text{avg}}\) is the total average optical power emitted by the TX and is given by  
\[P_{\text{avg}}=\lim_{T\to\infty}\frac{1}{2T}\int_{-T}^{T}\sum_{i=1}^{3}x_{i}(t )\,dt\,. \tag{18}\]  
In high-speed VLC schemes, such as CSK-based VLC systems, the impulse response of the LED must be considered [25]. By denoting the impulse response of the LEDs as \(h_{\text{LED}}(t)\), Equation (15) can be rewritten as  
\[y_{j}(t)=\sum_{i=1}^{3}h_{\text{LED}}(t)*h[i,j](t)*x_{i}(t)+n_{j}(t)\,, \tag{19}\]  
where \(\max_{t}(h_{\text{LED}}(t))=1\). The DC gain of the electro-optical channel, between the \(i\)th LED and \(j\)th PD, \(H_{0}^{\text{el}}[i,j]\), is given by  
\[H_{0}^{\text{el}}[i,j]=\int_{0}^{\infty}h[i,j](t)\,dt\,. \tag{20}\]  
In this context, we can define the average photocurrent produced at the \(j\)th PD due to light coming from the \(i\)th LED, \(I_{\text{avg}}[i,j]\), as  
\[I_{\text{avg}}[i,j]=H_{0}^{\text{el}}[i,j]\cdot P_{\text{avg},\,i}\,. \tag{21}\]  
In the VLC literature, additive noise is usually decomposed into the two dominant sources of noise in the VLC link: thermal noise and shot noise. The former, also known as Johnson-Nyquist noise, accounts for the thermal fluctuation (i.e., the temperature) in the particles that constitute the receiver electronics. The later accounts for the noise caused by the fluctuation in the number of photons that hit the \(j\)th PD within a certain time unit. Thermal noise is modeled as additive white Gaussian noise (AWGN), since it is the result of many independent events (thermal fluctiation of individual electrons). Similarly, shot noise is well approximated by AWGN thanks to the central limit theorem, as it is the superposition of a large number of independent events (photons hitting the PD at different times) [28]. With this in mind, and considering that thermal noise and shot noise are statistically independent, the noise variance can be further decomposed as follows:  
\[\sigma_{j}^{2}=\sigma_{\text{shot},\,j}^{2}+\sigma_{\text{thermal}}^{2}, \tag{22}\]  
where \(\sigma_{\text{shot},\,j}^{2}\) is the shot noise variance, and \(\sigma_{\text{thermal}}^{2}\) is the thermal noise variance.