How to get continuous spectral data into intensities of channels centered around wavelengths?

Currently, I am looking into using a spectral sensor from SparkFun in order to obtain spectroscopic data to feed into a trained neural network, however this sensor gives intensities based on inputs from channels centered around different wavelengths. The product can be seen here: <https://www.sparkfun.com/products/14351>


In order to generate the data to train our algorithm, we plan to take spectroscopic data of random samples of dirt and add traces of our target chemical's spectrum (i.e., add together and renormalize). What is a good way to get our continuous spectrum data into the format given by the sensor?


I was considering the using the Fourier transform on the continuous data and using the values located at the frequencies at which the channels are centered to "convert" the data to the proper format, but I'm not sure if this is physically correct. I know that $f=\frac{c}{\lambda}$, so maybe there needs to be a constant factor thrown in somewhere.


I'm not very well versed in chemistry, so I would appreciate some advice about this situation or more resources which could help enlighten me on this topic. Thank you in advance!




Based on the information in the link, the near-IR sensors can only give a response to channels: 610nm, 680nm, 730nm, 760nm, 810nm and 860nm, each with 20 nm FWHM. The sad news is that one cannot *extract more information from less*, not even by any fancy transform. The information is lost permanently because of a discontinuity of wavelengths. So, this data cannot generate a continuous spectrum of a sample all the wavelengths from 610 to 860 nm.


Perhaps all one can do is to look at the intensity patterns from the six channels and use that for training. Each channel output is a single number corresponding to the intensity to each nominal $\lambda$ with 20 nm bandwidth. So this sensor will generate six numbers for each analyzed sample. That is all. There is no way to interpolate in between the wavelengths, at least in NIR spectroscopy.


 4

My interpretation of the goal here is to take a "continuous" spectrum (or *high-resolution*) obtained with a good spectrometer and to convert that spectrum into a format comparable to that obtained with the SparkFun sensor.


The procedure of turning continuous data or rather, *discretely* sampled continuous data, into a new discrete spectrum with amplitudes at a new set of specific pre-selected frequencies is called re-sampling or binning, depending on the sampling rate of the input data.


If the input spectrum is oversampled, such that all of the desired frequencies are available at the same or comparable resolution, then it becomes a question of averaging over an appropriate interval (window) around each desired frequency. How to do this is not necessarily trivial (because the instrument has a filter of a particular shape over the window of each bin) but binning, meaning breaking up the original spectrum into bins and summing the contents of each bin, is one way to do this. Applying a polynomial interpolation function over each bin as a means of averaging (smoothing) is another. The results should be similar, the output for each bin (frequency) being a weighted average.


Here there is a registry issue in that neither resolution nor sampling rate match between the input and output. The easiest solution is to interpolate the input spectrum, applying appropriate smoothing (such as with a Savitsky-Golay interpolator) before resampling. Most numerical packages make this relatively easy to do. This is not a problem if the original "continuous" spectrum has high-resolution.


You also need to normalize the spectra somehow to compare them. If the input spectra vary in origin or how they were acquired or in the nature of the samples this might be an issue. IR spectral intensity, as I understand it, is proportional to concentration but peak intensities also depend on vibrational force constants which can vary between samples. I actually don't know what is the best way to do this part (re-normalization). It might involve some trial and error and visiting the literature.


 2