# A Python-Based Indoor Channel Model with Multi-Wavelength Propagation for Color Shift Keying
## 2 Recursive Channel Model  
The comprehension of the diverse behaviors of light is derived from two fundamental principles: the manner in which light waves propagate through space, and the manner in which these waves interact with matter [18]. The geometric optic is a simplified model for the propagation of light. It is employed to describe the reflection and refraction of light by objects, mirrors, and lenses, assuming that the wavelength of light is much smaller than the scale of the objects with which light interacts. This model forms the foundation of the ray-tracing technique, which we employ to model indoor optical channels. The recursive channel model is founded upon the principles of geometric optics and offers a valuable methodology for simulating the propagation of light in indoor settings, including empty rectangular rooms. This method can help to simulate the effects of light transmission and reflection within the space, providing a framework for analyzing communication systems such as VLC. The model presented in this work extends the original model introduced in [17], incorporating several key features essential for the analysis of CSK modulation. First, it estimates the power received by the detector across multiple central wavelengths. Second, the model simplifies the computation of received power at each wavelength, allowing for calculations up to ten orders of reflections. Third, based on the received power at each wavelength, the model estimates the spectrum received by the photodetector. Fourth, it evaluates inter-channel interference by analyzing the received spectrum and the spectral responsivity of the photodetectors. Fifth, photometric and colorimetric metrics such as the illuminance, colorimetric coordinates, correlated color temperature, and color rendering index are derived from the spectrum estimation. Sixth, the model accommodates custom CSK constellation designs to calculate the received spectrum and associated photometric and colorimetric metrics. Finally, the model estimates the symbol error rate as a function of the source luminous flux. These advancements represent the primary contributions of the current model compared to the original work. The following section presents the underlying logic of the recursive model. The recursive model accounts for two types of responses when calculating the power received by the photodetector: the line-of-sight components between the light source and the photodetector (\(l^{0}\)), and the non-line-of-sight components (\(l^{k}\)). In Figure 3, the direct ray from the light source over a distance \(d_{0}\) represents the LOS component. A ray emitted by the light source and reflected by a single reflective element before reaching the photodetector (with distances \(d_{1}\) and \(d_{2}\)) is classified as a first-order NLOS component. If the ray reflects off two surfaces before reaching the photodetector, it becomes a second-order NLOS component. Thus, the CIR can be expressed as the superposition of the LoS and the infinity reflections:\[h_{n}(t;S_{n},R_{n})=h_{n}^{0}(t;S_{n},R_{n})+\sum_{k=1}^{\infty}h_{n}^{k}(t;S_{n},R _{n}) \tag{3}\]  
where \(h_{n}^{k}(t)\) is the CIR of the components undergoing exactly \(k\) reflections, \(h_{n}^{0}(t)\) is the LoS response, and the sub-index \(n\) indicates that the CIR is computed for multiple wavelengths; thus, \(h_{n}(t)\) represents the CIR at the n-th central wavelength and the symbol \(t\) represents the variable representing time.