We used a genetic algorithm to optimize the location of a specified number of channels. This method also allows us to identify the global minimum, avoiding local minima. The genetic algorithm uses a population size of 100 candidate solutions, each candidate being a group with a specified number of wavelengths. At each step, the best (that is, those who produce the lowest mean square error) 5 children pass to the next generation, the next 72 children cross their data to vary the genes (weighted by a random number from a Laplace distribution, see ) and the other 23 are again randomly generated. All candidate solutions comply with two rules: adjacent wavelengths are distanced by more than 5 nm, and they must remain within 440-900 nm. The minimum number of wavelengths is set to two, as determining both Soc and C is impossible with one value. For each candidate solution, we gauge its performance by applying the spectral deconvolution method discussed above. To do so, we simulate an ideal multi-wavelength sensor by using the "continuous" spectral database reported in , discretized according to the corresponding wavelength. Note that this approach omits optical interferences or other distortions that occur in a real sensor. The procedure is computed using the MATLAB optimization toolbox.