Improved monte Carlo ray-tracing algorithm based on importance sampling

This paper proposes an improved ray-tracing algorithm with importance sampling (IS) to reduce the computational complexity. For multiple receiver situation, we provide improved IS including adaptive and weighted optimization.

considered as industrial equipment.Four LED arrays are deployed on the ceiling, which can be characterized by Lambertian Model.We place several optical receivers on the ground, and study the channel characteristics.The actual environment is shown in Figure 1.
We focus on a single ray.For a LOS link, the gain between transmitter and receiver (denoted as P los ) can be obtained based on the source model.Then, for a NLOS link, we trace the ray with initial probability 1-P los .At each collision point we calculate the path loss and new direction, as well as received probability P rec from this collision point.The probability of such ray is updated as ) e   is the exponential path loss and P ref is the reflection loss.Setting P liv as the minimum survival probability, once the probability of a ray becomes lower than P liv , the calculation of such ray terminates, and the calculation of a new ray starts.The estimation accuracy of MC method depends on the number of ray samples.A large number of ray samples yield high estimation accuracy, but at the cost of long computational time.In complicated indoor environments, the calculation time for each ray sample will be longer.Therefore, when calculating the expectation of random variables based on the sample mean, to reduce the number of samples needed, IS is adopted to increase the sampling probabilities of intervals that contribute significantly to the objective function.
In the ray-tracing, the sampling objective is the outgoing direction of rays, related to azimuth angle  and zenith angle .Denote ℎ ,  as the link gain in the outgoing direction ,  .Assuming that the outgoing direction follows prior distribution  ,  , the average link gain can be approximated using the samples of distribution  ,  as where  is the number of samples drawn from distribution  ,  .Consider the scenario with small ℎ ,  in dominant intervals of  ,  , such that samples in these intervals contributes very little in  ℎ , leading to low sampling efficiency.IS can be adopted to solve this issue.Specifically, we choose another distribution  ,  with similar shape to ℎ ,  , such that the samples based on  ,  tend to fall in the intervals with large value of ℎ ,  .The expectation of ℎ ,  can be approximated using the samples of distribution  ,  as where  is the number of samples drawn from distribution  ,  .Accordingly, we obtain samples based on IS distribution  ,  , where   ,  /  ,  is the importance weight.For IS-based ray-tracing, we adopt uniform sampling (US) method as the initial distribution and performance comparison benchmark, Based on the above uniform distribution, we choose a receiver to record the contribution of each ray.It is seen that the contribution of rays from different directions varies greatly, which justifies the approach of importance sampling.
It is difficult to obtain the optimal importance distribution analytically, and we conduct pre-test to obtain distribution  ,  .We divide the angle space into   intervals, and set ∆ 2/, ∆ / 2 .In the n-th test, we obtain probability  ,  by summing the function values ℎ ,  in different intervals, i.e.
( ) ( ) After repeating  tests, we sum all  ,  with respect to , and normalize to obtain importance distribution  ,  .The ray-tracing is performed based on distribution  ,  .
We conduct ray-tracing simulation based on the room model in Figure 1.The configuration parameters are listed in Table 1.
We adopt US and IS distributions to conduct ray-tracing, under the same environment and number of rays.The expectation and standard deviation are shown in Table 2.It is seen that at the same number of samples, IS method shows around half standard deviation as that of US method.For the MC method, the number of samples is positively correlated with the variance.In other words, IS can achieve the same accuracy as US with about 25% of samples.Considering that the calculation time spent on each sample is basically the same, IS method can save approximately 75% of the calculation time compared with US method.

Parameters Value
Receiver area

IS for multiple receivers
Numerical results show that IS distribution  ,  varies greatly at different receiver positions.At each receiver position, we need to test and estimate distribution based on new receiver position, with high computational complexity for multiple receivers.Ray multiplexing can be adopted to reduce the computational complexity.To adopt the same distribution for all receivers, we propose the following algorithm.Firstly, for each receiver we can obtain an IS distribution  ,  , where  is the index of receiver.Then, we obtain the weighted sum with weight   to obtain a new distribution  ,  , which can be adopted as the IS distribution for all receivers.Similar to the previous text, we divide the angle space into   intervals, and set ∆ 2/, ∆ / 2 .In the n-th test for receiver t, we obtain probability  , ,  in different intervals.After repeating  tests, we sum  , ,  with respect to , to obtain  ,  .We sum  ,  with weight   for receiver t, and normalize to obtain importance distribution  ,  as ( ) ( , ) ( , ) ( ) Ray-tracing is performed based on distribution  ,  .Figure 2 is the overall block diagram of our algorithm, which shows the implementation process of the proposed ray-tracing system using IS algorithm.
We conduct simulation in the room model as shown in Figure 1.We consider open room and room with object, and set 20 receivers on the ground.We first investigate the performance under uniform weight.After simulating 20 times, the standard deviation for each receiver under individual IS distribution is shown in Figure 3(a).It is shown that in most locations, the new distribution has lower standard deviation than US.Furthermore, we use different distributions to conduct simulation, as shown in Figure 3(b).Let r denote the distance between the receiver and transmitter.The blue curve represents the result of uniform sampling.Labels 1/, 1/ , ,  and 1 represent the scenarios where the weight for each receiver is proportional to 1/, 1/ , ,  and uniform weight, respectively.It is seen from Figure 3(b) that the optimization of the weight leads to significant gain over US method under appropriate weight rules.However, inappropriate weight rules may lead to less gain or even no gain.Thus, the selection of the weight rules is the key to IS for multiple receiver.

Conclusion
We have proposed an improved ray-tracing approach for indoor VLC channel modeling via importance sampling, and extended it to the scenario with multiple receivers.It is demonstrated that the proposed approach can reduce the computational complexity and increase the accuracy.

Figure 3 .
Figure 3. (a) IS result in different environment.(b) Influence of different weight.