## Abstract

Precise spectral and colorimetric simulations in commercial ray tracing software require realistic light source models, which provide spectral information as a function of angle and spatial dimension. We describe and validate a general workflow to create hyperspectral LED models as a linear combination of spectral models. The workflow only requires user defined precisions and rayfiles obtained with different optical filters. The rayfiles are transformed into histogram based models, whose precision is evaluated by normalized cross-correlation values of their intensity distributions in the near-, mid- and far field. Additionally, the concept is evaluated with a spatial and spectral well defined test device.

© 2016 Optical Society of America

## 1. Introduction

The illumination quality, for instance color homogeneity, color mixing or other parameters related to actinic action spectra, is an important aspect in modern lighting technology. Especially color fringes and color mixing are problematic due to spatially and angular varying spectral distributions of LEDs. Color inhomogeneity reduction of LED based lighting systems is therefore an important field of research [1–5]. The design of color mixing optics [6–8] relies on information regarding the colorimetric and spectral variations of the source. An improved light source model increases the precision of the optical simulations.

If the ray-optic assumption is used and polarization is neglected, the 7-dimensional plenoptic function *R*(*X*, *Y*, *Z*, *ϕ*, *θ*, *λ*, *t*) is the most general description of the radiation pattern of a light source, in which (*X*, *Y*, *Z*) describes the starting point of each ray, (*ϕ*, *ϑ*) the direction, *λ* as wavelength the spectral information and *t* the time [9]. As the steady state condition in photometry neglects temporal variations, *R* is reduced to a 6-dimensional function. Near field goniophotometry [10–12] can be used to directly measure a 5-dimensional *R*(*X*, *Y*, *Z*, *ϕ*, *ϑ*). Only the spectral information is lost due to its integration on an imaging luminance measurement device (ILMD).

The typical result of a camera based near field goniophotometer measurement is called rayfile (also referred to as ray file). A rayfile is a randomized statistically discrete description of a light source given as a list of rays. Each ray is a vector, containing at least a starting point and a direction in the 3-dimensional space. The relative distribution is either coded in an individual amplitude of each ray or is implied in the density of the rays with a constant amplitude [13].

An industrial used approach to add varying spectral information to rayfiles of phosphor converted white LEDs combines two spectrally sharp separated rayfiles for the LED and phosphor [14]. However, it cannot be used in general because the required sharp spectral separation does not work for any arbitrary spectrum. The first approaches to create hyperspectral rayfiles for arbitrary spectra are proposed in [15, 16]. Both combine goniophotometric ILMD measurements with angular resolved spectral measurements at the same angular positions. The spectrum for each spatial and angular position is either obtained by a spectral variation of the far field spectrum to match measured near field chromaticities [15] or by a direct reconstruction based on the narrowband ILMD measurements [16]. Both models require a high data amount because each angular and spatial position stores a spectral distribution. A reduction of the spectral information is necessary to limit the data amount. Jacobs et. al reduced the spectral information by applying a principal component analysis to the angular resolved spectral data [17]. The principal components are combined with rayfiles to create angular resolved spectral rayfiles. However, this method cannot account spatial spectral variations. Lee et. al [18] used one hyperspectral near field image and combined it with angular resolved spectral measurements at different measurement distances. Their spectral information is reduced to spectral bands, which are derived based on a correlation analysis. Finally, rayfiles in which the starting point probability bases on the hyperspectral image and the ray direction probability bases on the angular resolved spectral measurements, are created and optimized. An important aspect of the approaches [15–18] is the measurement time. Angular resolved spectral measurements require much more time than similar resolved ILMD based measurements since the integration time of a spectral measurement is larger than the integration time of an ILMD.

To utilize the fast ILMD measurements and the spectral resolution of a spectrometer, we proposed a workflow as shown in the upper part of Fig. 1. It relies on a combination of different ILMD based near field measurements and one global spectral measurement [19]. The workflow starts with the determination of the individual semiconductor and phosphor basis spectra. The basis spectra are needed to select an optimal filter set, which is used to perform the ILMD based near field measurements. The concept minimizes the number of measurements to the number of sources and reduces the uncertainty of the obtained spectral information by the filter selection. While the upper part of Fig. 1 is described in detail in our previous publication [19], this paper extends the workflow by the lower part of Fig. 1 and therefore enables the practical application of our approach, which is the creation of hyperspectral LED models and spectral rayfiles. We focus on conventional rayfiles as input data since they offer a high precision, are widely available and can be obtained with commercially available measurement equipment.

We start by summarizing the basic concepts of the spectral reconstruction in section 2. In the beginning of section 3 we discuss that the direct application of the spectral reconstruction is not possible due to the discrete nature of rayfiles. Therefore the goniophotometric measured rayfiles are transformed into continuous histogram based measurement models, which are described in subsection 3.1. The model accuracy is ensured by two precision parameters. The first precision parameter *NCC* (normalized cross-correlation), which is summarized in subsection 3.2, validates the model resolution. In subsection 3.3 it is shown that the spectral reconstruction on high precision models regarding the *NCC* leads to insufficient spectral reconstruction results. Therefore we derive the second parameter, which is the physically motivated amount of negative amplitudes, to validate the spectral models. In subsection 3.4 we introduce a post-processing step, which utilizes neighborhood relations in the models and therefore minimizes those reconstruction errors. This improvement enables the derivation of the final workflow in subsection 3.5, which combines high model resolutions and high spectral accuracies by taking into consideration both user defined precision parameters and their relations.

While the concept works for every arbitrary LED spectrum, which might also contain phosphor conversion, each step is illustrated by the example of a RGB-LED. We chose the RGB-LED because the spectrum and position of each spectral source are well separated and therefore well known. Thus, the RGB-LED enables the possibility to easily detect spectral reconstruction errors and offers a reasonable validation of the whole calculation process described in section 3.

## 2. Basic concepts of the spectral reconstruction

Our main assumption is that the spectral behavior of the plenoptic function *R*(*X*, *Y*, *Z*, *ϕ*, *ϑ*, *λ*) can be described as weighted sum of given or phenomenologically modeled constant basis spectra *S _{i}* (

*λ*) as shown in Eq. (1). Each basis spectrum

*S*describes one physical spectral source and only its amplitude

_{i}*A*(

_{i}*X*,

*Y*,

*Z*,

*ϕ*,

*ϑ*) remains a function of the angular and spatial dimensions.

If the test spectrum consists of *n* basis spectra, *n* goniophotometric near field measurements with *n* different filter transmission profiles *τ _{i}* result in

*n*measurement values

*M*as described by Eq. (2). The variable

_{i}*τ*takes into account the spectral transmission profile of the remaining system, such as objective lens, ILMD and neutral density (ND) filter.

_{sys}Since each goniophotometric measurement is a relative distribution independent of the absolute transmission of the chosen filter, the additional condition in Eq. (3) has to hold. It means that each row of the matrix *M*_{S}* _{τ}* adds up to 1, which implies that each relative goniophotometric measurement describes in sum one spectral source. Also different rayfiles typically contain a different amount of rays. Therefore, the final reconstruction equation as shown in Eq. (4) includes an additional diagonal matrix containing the number of rays

*N*to ensure that each ray independent of the rayfile has the same importance. The equation shows that the spectral reconstruction only requires the prior knowledge regarding the measurement system

_{i}*τ*and

_{i}*τ*and the basis spectra

_{sys}*S*(

_{i}*λ*) to define the matrix

*M*

_{S}

*. Afterward, the measured goniophotometric data provides*

_{τ}*M*and

_{i}*N*.

_{i}The basis spectra of our test RGB-LED F50360 from Seoul Semiconductor [20] are shown in Fig. 2. Spectral rayfiles of the RGB-LED can be created by applying Eq. (4) on the three measured rayfiles *M*. We used the standard color filters
${\overline{x}}_{short}(\lambda )$,
${\overline{x}}_{long}(\lambda )$ and *v*(*λ*) as shown in Fig. 2 to create those measurements with a RIGO-801 near field goniophotometer with a measurement distance of 310 mm in steps of Δ*ϕ* = Δ*ϑ* = 2.5°. The transmission profiles *τ _{i}* were obtained in steps of 5 nm.

The resulting
${M}_{\mathrm{S}\tau}^{-1}$ is shown in Fig. 2. The first matrix row shows that the first measurement with
${\tau}_{1}(\lambda )={\overline{x}}_{short}(\lambda )$ covers approximately one spectral source because the first matrix value is nearly one and the remaining values are orders of magnitude smaller. The first row describes the reconstruction of the blue LED. However, the reconstruction of the green and red LED requires a linear combination of all measured rayfiles, because neither
${\overline{x}}_{long}(\lambda )$ nor *v*(*λ*) measured only the individual green or red LED. The second filter
${\overline{x}}_{long}(\lambda )$ measured a linear combination of the green and red LED and the third filter *v*(*λ*) measured a linear combination of all LEDs. This is also indicated by the second and third row of
${M}_{\mathrm{S}\tau}^{-1}$, because at least two values in each row are in the same order of magnitude.

Figure 3 shows the test device and the normalized irradiance of all measured rayfiles *M*_{1}–*M*_{3} with 10 × 10^{6} rays in the LED plane. We chose this plane since there the irradiance provides a sharp image of the individual LEDs, which can be verified by a comparison with the photographic image. The LED at the top of the images is the green LED. The blue LED is on the left hand side and the red LED on the right hand side.

## 3. Creating spectral LED models

Theoretically, the general problem is solved by applying Eq. (4) on the measured rayfiles. However, due to the discrete nature of rayfiles, the rays of different rayfiles will not be defined at the same positions with the same directions and a direct calculation is not possible. Therefore applying Eq. (4) requires a transformation from the rayfiles to equally resolved measurement models as shown in Fig. 4. Afterward, Eq. (4) is applied on the measurement models *M* to achieve the spectral models *A*. Finally, the spectral models can be used to create spectral rayfiles.

#### 3.1. Transformation of discrete ray files to continuous models

The transformation of the original rayfiles to the models is visualized in Fig. 5 and can be divided into three main steps:

- First a spatial histogram, which bases on the starting points on the envelope of the rayfile is created. The spatial histogram contains
*N*_{spatial}bins. Figure 5 shows the generation of the spatial histogram on the left hand side. - For the angular model, the envelope is divided into
*N*_{Voron}voronoi regions such that each regions covers approximately the same amount of ray starting points as shown on the upper part of the right hand side in Fig. 5. - In the last step one local angular distribution curve (ADC) for each voronoi region is created. The ADCs are described as histograms with
*N*_{angular}bins, which base on the directions of all rays in the voronoi region. In total there are*N*_{Voron}ADCs. The process is visualized in the right hand side of Fig. 5.

The parameter *N*_{spatial} describes the spatial model. The parameters *N*_{Voron} and *N*_{angular} both describe the angular model. While *N*_{Voron} defines the number of spatial areas with the same relative angular distribution, *N*_{angular} is the number of the angular distributions histogram bins. There is a trade-off between the angular resolution *N*_{angular} of each ADC and their overall number *N*_{Voron}. If the amount of ADCs increases, less rays are associated with one ADC. The overall model is visualized in Fig. 6. The false colors display the amplitudes of the spatial histogram bins and the voronoi regions show the spatial areas with constant relative ADCs. Note that in contrast to the spatial histogram the ADCs can be described as sparse matrices to reduce the data amount because large parts of the ADCs equal zero as the local angular distributions on the enveloping hemisphere are quite directional.

As a histogram is an estimation of a probability function, the spatial histogram can be interpreted as the probability of occurrence *M*_{spatial}(*X*, *Y*) of a random ray starting point (*X*, *Y*) on the hemisphere. That ray starting point also defines the voronoi region *Voron*(*X*, *Y*) and thus its specific angular histogram. Therefore the probability of occurrence *M*_{angular}(*Voron*(*X*, *Y*), *ϕ*, *ϑ*) of a random ray direction (*ϕ*, *ϑ*) does also depend on the starting point. Finally, the overall probability of occurrence of a ray is given by the product of *M*_{spatial}(*X*, *Y*) and *M*_{angular}(*Voron*(*X*, *Y*), *ϕ*, *ϑ*) as described in Eq. (5).

#### 3.2. Estimating the precision of the light source models

The model quantizes the original rayfiles and therefore requires the definition of the resolution parameters *N*_{Voron}, *N*_{angular} and *N*_{spatial}. The direct definition of those resolution parameters is not intuitive and also depends on the initial data resolution of the measurement and the rayfile. Therefore it is necessary to compare the original rayfile with the rayfile that is created by Eq. (5). The concept is visualized in Fig. 7. As proposed in [21] the similarity of both rayfiles is obtained by evaluating their normalized cross correlation values at different distances *R* to cover near-, mid- and far field. The *NCC* of measurement model *i* at distance *R* is defined in Eq. (6).

The variable *I _{i,R}*(

*ϕ*,

*ϑ*) is the achieved intensity distribution at distance

*R*of a rayfile, which was created with measurement model

*i*, and the variable

*J*(

_{i,R}*ϕ*,

*ϑ*) is the achieved intensity distribution at distance

*R*of the original rayfile, which was used to create measurement model

*i*. The variables

*Ī*and ${\overline{J}}_{i,R}$ are the mean values of the corresponding intensity distribution. Each intensity distribution is achieved by assigning the rays to equally distributed points on an enveloping hemisphere. The distance

_{i,R}*R*defines the radius of the hemisphere. The generation of those points is described in [22, 23].

As the envelope of the RGB-LED was set to 5 mm, we evaluated the intensity distributions at the distances 6, 7, 8, 9, 10, 20, 30, 40, 50 and 300 mm. Each of the equally distributed sampling points used to determine the intensity of the RGB-LED covered approximately a solid angle of 0.0025 sr. At this resolution the *NCC* between the original rayfile containing 10^{6} rays and the original rayfile containing 10 × 10^{6} rays from the same measurement is above 0.996 at each distance. The difference can assumed to be noise, which results in the smaller rayfile due to the high resolution. As a *NCC* of above 0.99 indicates good agreement [18, 21], that resolution is suitable for the precision estimation of the created light source models.

#### 3.3. Negative and false positive amplitudes

All resolutions *N*_{spatial}, *N*_{Voron} and *N*_{angular} as well as all positions of the voronoi regions are the same for each measurement model. That way Eq. (4) can be performed on the spatial histogram and all ADCs to create the histograms of the spectral models. Those histograms finally contain the amplitudes A of the physical basis spectra.

Especially in case of high model resolutions, the obtained results also contain negative amplitudes *A*^{−}. However, as A represents the amplitudes of the physical basis spectra, negative amplitudes must assumed to be reconstruction errors. Furthermore the existence of a negative amplitude *A*^{−} implies the existence of a false positive amplitude because the overall integral of the amplitudes A is constant for each model, which is indicated by Eq. (3). We can define the amount of negative amplitudes Q as the relation of negative amplitudes |*A*^{−}| and all amplitudes |*A*^{−}| + *A*^{+} in Eq. (7) as a quality metric for each spectral model.

The amount of negative amplitudes gets larger with increasing resolution parameters, which indicates a trade off between the amount of negative amplitudes *Q* and the *NCC*. This trade off is visualized in Fig. 8. It visualizes the irradiance in the LED plane of the green LED spectral model. If *Q* is small, only the green LED is represented, but the irradiance is also blurred out due to the low angular and spatial resolution of the histograms, which is quantitatively verified by the *NCC*. However, if the resolutions are very high, spectral artifacts, which are caused by false positive rays, start to occur. Based on a more detailed analysis regarding the occurrence of negative amplitudes at different model resolutions, we derive a post-processing step to strongly reduce those reconstruction errors in the following subsection.

#### 3.4. Improvement by nearest neighbor calculation

If the resolution increases, the ray number in the bins further decreases until statistically empty bins start to arise in the measurement models. This is caused by the high frequency noise of the original rayfiles. In that case, bins are statistically subtracted from empty bins. This results in negative values at these bins and false positive values at other bins, which indicate a mismatch between the measurement models. However, the low amount of negative amplitudes in case of low resolutions shows that there is no fundamental mismatch between the measurement models. As the mismatch only arises in case of high resolution models, it can be concluded that it arises due to the high frequency noise and that the false positive values therefore occur in the neighborhood of the negative values.

While false positive values cannot be distinguished from correct positive values directly, all negative values can assumed to be artifacts. This important physical boundary condition always holds since the basis spectra are the physical basis spectra of the source. Therefore the false positive values can be reduced strongly by searching for all negative bins, which compensate positive bins in their neighborhood. The overall integral of the model remains constant during the process. The nearest neighbor calculation takes place in the spatial histogram and all ADCs. The process repeats itself while increasing the searched neighborhood region until a user defined threshold *Q _{final}* is reached. If the resolution of the models is very high and a large part was not calculated correctly, the nearest neighbor calculation performs the remaining calculation and therefore reduces both negative values and false positive values.

Figure 9 visualizes the improvement due to the nearest neighbor calculation compared to the original calculation with a *NCC* > 0.9998 and
${Q}_{final}=\frac{{Q}_{start}}{1000}$ in case of the tested RGB-LED. The variable *Q _{start}* refers to the amount of negative amplitudes of each spectral model before performing the nearest neighbor calculation. The artifacts caused by false positive rays are reduced strongly for both the green and red LED. However, details as the electrodes and the ring remain visible.

#### 3.5. Adaptive resolution via precision parameters

Due to the improvement caused by the nearest neighbor calculation for models with high resolutions, the resolution can be optimized until a user defined *NCC* is reached. We define the auxiliary variable calculation success *x* as the 1/*x* fraction of not correctly calculated bins in the spectral models. If the calculation success is 100, statistically only 1/100 of all bins was not calculated correctly. If it is one, all bins were not calculated correctly.

The amount of negative amplitudes *Q* of a spectral model directly depends on the calculation success and the matrix row of
${M}_{\mathrm{S}\tau}^{-1}$, which was used to create the spectral model. The relation is described in Eq. 8. The variable *a* is the sum of all negative matrix values and the variable *b* is the sum of all positive matrix values, which occur in the row of
${M}_{\mathrm{S}\tau}^{-1}$.

We will use the calculation success, which does only depend on the resolution parameters of the models, as an auxiliary variable to determine the histogram resolutions *N*_{spatial} and *N*_{angular}. It does not only trace both resolutions back to one parameter, but it also rates the interaction of the original rayfiles according to Eq. (4) and allows a direct estimation of the initial calculation artifacts according to Eq. (8).

The final workflow is shown in Fig. 10. The user defines the desired precision as minimal *NCC* at different distances and *Q _{final}* for the neighborhood calculation. To start the optimization an initial value for the calculation success

*x*is required as well.

At first the *n* original rayfiles are transformed into *n* histogram based measurement models using arbitrary low initial model resolutions *N*_{angular}, *N*_{spatial} and *N*_{Voron}. Afterward the *n* spectral models are calculated according to Eq. (4). Equation (7) is used to estimate the current *Q* = *Q _{current}* of the spectral models. The initial calculation success

*x*defines a

*Q*=

*Q*via Eq. (8). Then

_{aim}*Q*and

_{current}*Q*are compared. We use algorithms such as bisection or false position [24] until

_{aim}*Q*≈

_{current}*Q*to adapt

_{aim}*N*

_{spatial}for the spatial histogram and

*N*

_{angular}for the ADCs. Those algorithms only require the assumption that the functional relation is one-dimensional and monotone and an allowed tolerance

*ϵ*. Strictly spoken

*ϵ*is also an input parameter. However, if the precision of the false position or bisection algorithm

*ϵ*is small, for instance below 1% of

*Q*(

*x*), its influence can be neglected.

If *Q _{current}* ≈

*Q*,

_{aim}*n*rayfiles are created from the measurement models to calculate their

*NCC*values with the original rayfiles as described in subsection 3.2. The

*NCC*obtained is compared with the desired

*NCC*. If the obtained

*NCC*is smaller than the desired

*NCC*, the remaining resolution parameter

*N*

_{Voron}is optimized for the given calculation success

*x*. If

*N*

_{Voron}is too small, the

*NCC*in the far field gets higher than in the near field because few ADCs with a high angular resolution are associated with large starting areas. If

*N*

_{Voron}is too large, the

*NCC*in the far field is smaller than in the near field for the same reason. The model introduces a fuzziness between far field and near field or rather the angular distributions resolution and its associated area for a given calculation success

*x*, which is adjusted with

*N*

_{Voron}.

If the desired *NCC* cannot be reached by adapting *N*_{Voron}, the initial *x* is reduced. If *x* can remain high, the initial artifacts are small. However, if *x* becomes small, the spectral models show artifacts as shown in Fig. 8. The process stops if the desired *NCC* is obtained. Finally, the nearest neighbor calculation reduces the initial calculation artifacts and completes the creation of the hyperspectral LED models.

## 4. Discussion

As shown by Fig. 10, the desired *NCC* results in a certain calculation success *x*. Their relation is also visualized in Fig. 11. The graphs show the achieved *NCC* displayed as 1 − *NCC* on a logarithmic scale at the tested distances for different calculation successes with original rayfiles containing 10^{6} rays in Fig. 11(a) and 10 × 10^{6} rays in Fig. 11(b). The *NCC* with the same calculation success is always higher in Fig. 11(b). This is to be expected because higher model resolutions can be achieved, before the noise of the larger and therefore higher resolved original rayfiles reduces the calculation success.

The graphs also verify that the calculation success *x* remains high for *NCCs* above 0.99 with typical original ray amounts, for instance 10^{6} or 10 × 10^{6}. According to [21] a *NCC* > 0.99, or rather 1 − *NCC* < 1 × 10^{−2}, indicates good agreement between model and measurement. Figure 8 supports this suggestion as it shows the irradiance of the spectral models in the LED plane although the calculated *NCC* displayed in Fig. 8 refers to intensity distributions of the measurement models at different distances as described in subsection 3.2.

The comparison of Fig. 9 and Fig. 3 shows that the workflow is capable of creating spectral and angular resolved spectral rayfiles. As the desired *NCC* of the measurement model was set to 1 − *NCC* < 3 × 10^{−4}, the reconstructed individual LEDs in Fig. 9 match the device shown in Fig. 3 with a high level of detail. Electrodes as well as reflections created by the surrounding ring are represented in the irradiance distributions created by the spectral models. Since the blue LED model is nearly represented by the
${\overline{x}}_{short}(\lambda )$ measurement, the reflections of the ring can be assumed to be represented well. The same reflection scheme is observed in the irradiance distributions of the green and red LED. The reflection is strong near the LED and nearly zero if the other LEDs shadow the ring.

The calculation time of the proposed algorithms mostly depends on the desired precision. Using original rayfiles each containing 10^{6} rays, our MATLAB implementation of the workflow required approximately 40 minutes on an average personal computer (Intel(R) Core(TM) i5-3470 CPU @ 3.2GHz and 16GB RAM) to create the hyperspectral LED models of the RGB-LED with a *NCC* of 0.996 and
${Q}_{final}=\frac{{Q}_{start}}{1000}$. In case of high precisions, the required resolutions become quite high, which increases both calculation time and the required RAM. To reconstruct the high precision hyperspectral RGB-LED model (*NCC* > 0.9998,
${Q}_{final}=\frac{{Q}_{start}}{1000}$, we used a simulation computer (Intel(R) Xeon(R) CPU E5-2670 v3 @2.3 Ghz and 98GB RAM). That reconstruction was completed within three hours. The generation of the spectral rayfiles from the model took only a few seconds in both cases. Details regarding the computational complexity of accessing a ray to a histogram bin are discussed in the next subsection.

#### 4.1. Rayfile based light source models

The aim of the proposed light source model is to allow a subtraction of rayfiles form each other for the purpose of creating spectral rayfiles by solving a system of linear equations. The model has to represent the original rayfile well. Therefore our solely rayfile based model uses and adapts concepts of similar light source models, which base solely on the sampling of rayfiles as well [25–27].

All rayfile based models require a spatial quantification on either a user defined envelope [25] or the given surface data of the light source [26, 27]. Similar to [25] we use a hemisphere as envelope since it is general and requires only two dimensions and known radius. Also all methods define local angular distributions, which are described as histograms.

The sampling grid of the angular histograms differs in all approaches. We obtain all histograms by sampling rays on equal distributed points on a sphere as described in [25]. The generation of those points is described in [22,23,25]. Those angular distributions offer the possibility to classify the rays using one-dimensional kd-search trees [25], which allow a very fast classification with a calculative complexity O(log *n*).

In [27] an adaptive interval size is used to define the spatial extended regions of the angular distributions. The idea is that each region contains a similar amount of rays such that the noise remains the same in the whole model. As Häring [27] we use a vector quantification algorithm - Lloyds algorithm [28] - to ensure that the ray number for each voronoi region or rather each angular distribution is approximately in the same order.

In [26] the resolution of the angular distribution is adapted by comparing the luminous flux of the spatial region with the flux, which results from integrating the local angular distribution curve. It starts with a low resolution in the angular space and slowly increases until the desired precision is reached. By slowly reducing the calculation success in the spatial and angular histograms of the spectral models, we use a similar concept. Also the definition of a precision parameter is more easy than the definition of a resolution.

#### 4.2. Limitations of the concepts

The most limiting assumption of the whole process is the constant basis spectra assumption. Therefore the workflow does not cover nonlinear effects such as phosphor saturation, self absorption or an inhomogeneous combination of different phosphor layers if their physical basis spectra are not available. Also all measurements require the steady state condition regarding electrical and thermal operation conditions.

Furthermore, the nearest neighbor calculation can only be used with physical motivated basis spectra because the usage of negative amplitudes requires the prior knowledge that they have to be calculation artifacts. Mathematical basis spectra, which would for instance occur if a principal component analysis is used to derive the basis spectra, may also create correct negative amplitudes within an individual model. They only compensate each other after the final combination of all models.

The resolution of the spectral rayfiles decreases due to the model creation process. Depending on the desired *NCC*, the resolution becomes too small for model areas with a high ray density and too high for areas with a low ray density. The latter leads to artifacts caused by false positive rays after an incomplete calculation. The areas with low ray densities can be detected and corrected by the nearest neighbor calculation. Although the neighborhood assumption of the negative and false positive values provides good results, it cannot be guaranteed that only false positive rays are used to compensate the negative rays, especially if the searched neighborhood reaches the order of histogram bins. Therefore, the nearest neighbor calculation is only able to reduce the initial artifacts to a certain point and the initial calculation success should remain as high as possible for the desired *NCC*. Another option to enhance the *NCC* without reducing the calculation success is to enhance the resolution of the goniophotometric measurements and the number of rays in the original rayfiles. However, the enhancement of the ray number directly influences the calculation time.

The proposed verification of the spectral reconstruction relies only on the matrix *M*_{S}* _{τ}*. Therefore spectral reconstruction errors, which are either induced by deviating transmission filter profiles or an insufficient description of the basis spectra, cannot be excluded even if the amount of negative amplitudes equals zero. This is only relevant in case of spectral complex systems. If, for instance, phosphor converted white LEDs are combined with red and green LEDs and their basis spectra are not directly available, their spectral overlap will reduce the precision of the numerical basis spectra deduction described in [19].

## 5. Conclusion and outlook

We described and validated a workflow to create hyperspectral LED light source models as a linear combination of spectral models each representing a constant physical basis spectrum. Therefore, we transformed conventional rayfiles into histogram based measurement models consisting of a spatial sampled hemisphere with a number of constant relative angular distributions. A reasonable model resolution with respect to the initial rayfile precision is achieved by the definition of a desired normalized cross correlation. That precision includes the acceptance of initial spectral reconstruction errors, which are evaluated by the amount of negative and false positive amplitudes in the spectral models. Afterward, the neighborhood relation between detectable negative and non-detectable false positive amplitudes is used to reduce the spectral reconstruction errors. The workflow neither requires time consuming angular resolved spectral measurements or hyperspectral measurements to create and verify the models, nor any geometric information about the device under test except an enveloping hemisphere. It can therefore be used on any 3-dimensional LED light source.

The reconstructed spectral models of a well known test RGB-LED correctly represented the three individual LEDs. If the *NCC* is set as high as 0.9998, the models even provide details, for instance the electrodes, which demonstrates the potential of the concept. The obtained rayfiles can be used directly in conventional raytracing software since their spectral information is correctly described by one global attached spectrum.

Since the histogram based spatial and angular models can be evaluated with calculative complexity O(log *n*) by kd-search trees, they can also be used for inverse ray tracing simulations. Due to the extension of the workflow described in this publication, the determination of the basis spectra might be the precision limiting factor from now on. In future work we will therefore consider to further optimize the deduction process of the basis spectra.

## Funding

Federal Ministry of Education and Research; Program Photonics Research Germany (13N13396).

## Acknowledgments

The authors would like to thank Julia Möhring and Daniel Großmann for carefully reading the manuscript and Inca Leopoldo Sayanca for his support. We acknowledge support by Deutsche Forschungsgemeinschaft and Open Access Publishing Fund of Karlsruhe Institute of Technology and Karlsruhe School of Optics and Photonics.

## References and links

**1. **Y. Shudong, L. Zongtao, L. Guanwei, T. Yong, Y. Binhai, and C. Kaihang, “Angular color uniformity enhancement of white light-emitting diodes by remote micro-patterned phosphor film,” Photon. Res. **4**(4), 140–145 (2016). [CrossRef]

**2. **S.-P. Ying, C.-Y. Lin, and C.-C. Ni, “Improving the color uniformity of multiple colored light-emitting diodes using a periodic microstructure surface,” Appl. Opt. **54**(28), E75–E79 (2015). [CrossRef] [PubMed]

**3. **H.-Y. Lin, Z.-T. Ye, C.-C. Lin, K.-J. Chen, H.-H. Tu, H. M. Chen, C. H. Chen, and H. C. Kuo, “Improvement of light quality by ZrO_{2} film of chip on glass structure white LED,” Opt. Express. **24**(2), A341–A349 (2016). [CrossRef] [PubMed]

**4. **C. Li, Z. Zhang, W. Chen, Z. Hu, X. Tang, W. Hu, K. SunC, -Y. Lin, X. Liu, and W. Chen, “Highly pure green light emission of perovskite CsPbBr3 quantum dots and their application for green light-emitting diodes,” Opt. Express **24**(13), 15071–15078 (2016). [CrossRef] [PubMed]

**5. **C. C. Sun, C. Y. Chen, C. C. Chen, C. Y. Chiu, Y. N. Peng, Y. H. Wang, T. H. Yang, T. Y. Chung, and C. Y. Chung, “High uniformity in angular correlated-color-temperature distribution of white LEDs from 2800K to 6500K,” Opt. Express **20**(6), 6622–6630 (2012). [CrossRef] [PubMed]

**6. **T.-S. Bonenberger, J. Baumgart, and C. Neumann, “Angular and spatial color mixing using mixing rods with the geometry of a chaotic-dispersive billiard system,” Adv. Opt. Technol. **5**(2), 157–165 (2016).

**7. **P. Liu, H. Wang, R. Wu, Y. Yang, Y. Zhang, Z. Zheng, H. Li, and X. Liu, “Uniform illumination design by configuration of LEDs and optimization of LED lens for large-scale color-mixing applications,” Appl. Opt. **52**(17), 3998–4005 (2013). [CrossRef] [PubMed]

**8. **S. Sorgato, R. Mohedano, J- Chaves, A. Cvetkovic, M- Hernández, P. Benitez, J. C-Miñano, H. Thienpont, and F. Duerr, “Efficient color mixing through étendue conservation using freeform optics,” Proc. SPIE **9572**, 95720G (2015). [CrossRef]

**9. **E. Adelson and J. Bergen, “The plenoptic function and the elements of early vision,” in “*Computational Models of Visual Processing*,” M. Landy and J.A. Movshon, eds. (MIT, 1991).

**10. **I. Ashdown, “Near-field photometry: a new approach,” J. Illum. Eng. Soc. **22**(1), 163–180 (1993). [CrossRef]

**11. **I. Ashdown and M. Salsbury, “A near-field goniospectroradiometer for LED measurements,” Proc. SPIE **6342**, 634215 (2007). [CrossRef]

**12. **M. López, K. Bredemeier, N. Rohrbeck, C. Véron, F. Schmidt, and A. Sperling, “LED near-field goniophotometer at PTB,” Metrologia **49**(2), 141–145 (2012). [CrossRef]

**13. **R. Dürr and U. Streppel, “Rayfiles for non-sequential raytracing,” in Proceedings of the International Light Simulation Symposium ILSIS, (Steinbeis-Edition, 2012) pp. 11–24.

**14. ** OSRAM Opto Semiconductors application note, “Importing rayfiles of LEDs from OSRAM Opto Semiconductors,” (OSRAM Opto Semiconductors, 2013), http:\\www.osram-os.com\Graphics\XPic5\00165120_0.pdf, (accessed, July, 2015).

**15. **R. Rykowski, “Spectral ray tracing from near field goniophotometer measurements,” Light. Eng. **19**(1), 23–29 (2011).

**16. **D. Hansen, S. Paul, and V. Schumacher, “LED Measurement to Obtain Polychromatic Raydata and their Value for Simulations,” in Proceedings of the LED Professional Symposium 2012, (Luger Research, 2012), pp. 112–119.

**17. **V. Jacobs, J. Audenaert, J. Bleumers, G. Durinck, P. Rombauts, and P. Hanselaer, “Rayfiles including spectral and colorimetric information,” Opt. Express **23**(7), A361–A370 (2015). [CrossRef] [PubMed]

**18. **T.-X. Lee, T.-L. Lu, and B.-S. Chen, “Combining near-field hyperspectral imaging and far-field spectral-angular distribution to develop mid-field white LED optical models with spatial color deviation,” Opt. Express **24**(14), A1094–A1106 (2016). [CrossRef] [PubMed]

**19. **I. Rotscholl, K. Trampert, U. Krüger, M. Perner, F. Schmidt, and C. Neumann, “Determination of tailored filter sets to create rayfiles including spatial and angular resolved spectral information,” Opt. Express **23**(23), 29543–29554 (2015). [CrossRef] [PubMed]

**20. ** Seoul Semiconductors, Technical Data Sheet F50360, Seoul Semiconductors, http:\\www.seoulsemicon.com\_upload\Goods_Spec\F50360_May2008_R01.pdf (accessed, July, 2015).

**21. **C.-C. Sun, T.-X. Lee, S.-H. Ma, Y.-L. Lee, and S.-H. Huang, “Precise optical modeling for LED lighting verified by cross correlation in the midfield region,” Opt. Lett. **31**(14), 2193–2195 (2006). [CrossRef] [PubMed]

**22. **M. Deserno, “How to generate equidistributed points on the surface of a sphere,” (Max-Planck-Institut für Polymerforschung, 2004), https:\\www.cmu.edu\biolphys\deserno\pdf\sphere_equi.pdf, (accessed, December, 2015).

**23. **L. Lovisolo and E. A. B. da Silva, “Uniform distribution of points on a hyper-sphere with applications to vector bit-plane encoding,” in Proceedings of IEE conference - Vision, Image and Signal Processing 2001, 148(3), pp. 187–193.

**24. **R. L. Burden and J. D. Faires, *Numerical Analysis, 9th Edition* (Brooks/Cole, 2011).

**25. **W. Cieszyński, J. Reiner, and M. Wójcik, “Advanced Light Sources with rays for rendering engines,” in Proceedings of the International Light Simulation Symposium ILSIS, (Steinbeis-Edition, 2012) pp. 25–42.

**26. **J. Audenaert, G. Durinck, F. B. Leloup, G. Deconinck, and P. Hanselaer, “Simulating the spatial luminance distribution of planar light sources by sampling of ray files,” Opt. Express **21**(20), 24099–24111 (2013). [CrossRef] [PubMed]

**27. **S. Häring, *Erweiterung des Simulationsprozesses von Lichtfeldern für die virtuelle Leuchtenentwicklung im Automobilbau* (Universitätsbibliothek Ilmenau, 2009).

**28. **T.-C. Lu and C.-Y. Chang, “A survey of vq codebook generation,” JIHMSP ,**1**(3), 190–203(2010).