Spectrometer calibration
Recently, I posted a note regarding further calibration of the spectrometer to the mailing list. Below is a restructured version of my post. It starts with a summary of different calibration steps that can be performed and then explains how these could be done. Some of these calibrations pose some challenges to the current spectrometer workflow.
There are four calibration steps that can be performed:
-
(1) Wavelength calibration. The spectrum is projected onto the ccd of the webcam. A pixel position on the ccd/image needs to be linked to the wavelength that ends up at that position. For this a light source with narrow peaks at known positions is used. This calibration is enough for identifying a peak in flame spectrometry or the wavelength of a certain absorption.
-
(2) Signal linearization. With this calibration, it is ensured that the measured value at a certain wavelength scales linearly with the intensity. This is not the case with jpegs and movies (see below), so needs to be corrected. This calibration step is essential if you want to compare two spectra (for instance in a reflection or absorption experiment).
-
(3) Relative intensity calibration. If you want to compare the signal at one wavelength with another wavelength, they should be calibrated to compensate for wavelength dependent ccd sensitivity and the effect of color filters. This calibration is not needed for absorption or reflection measurements because the calibration factors obtained in this step are divided out in the calculation. However, for calculating colors, identifying lamps or comparing the ratio's of two compounds emitting at different wavelengths, this calibration is needed.
-
(4) Radiometric calibration. This calibration finds the single scaling factor that converts the spectrum after (3) to W/m^2/nm. This calibration is probably mostly for scientific completeness. It will also be hard to maintain.
Below, I briefly explain how the calibrations could be performed. Each calibration needs the calibrations above it to be performed first.
1. Wavelength calibration
Here, you're looking for a function that converts the pixel positions x into a wavelength: lambda = f(x). This can be done by using a light source with several known narrow emission lines. Typically gas-discharge lamps are used. A readily and commonly available lamp is a CFL; however, because of the phosphor in the lamp, several 'exotic' peaks can be present, and these can be different from lamp to lamp. It is therefore probably best to stick with the mercury and argon peaks.
In the current software (Spectral Workbench), this calibration is done with a linear correction: f(x) = c0 + c1*x. However, usually it is done with a quadratic or cubic function. For this at least three or four known peaks are needed and they need to be spread over the used wavelength range.
2. Signal linearization
In jpegs, gamma compression is used to convert the raw sensor data into pixel values (see http://www.cambridgeincolour.com/tutorials/gamma-correction.htm). This means that if the intensity changes from 9 to 4, the pixel values will be 9^(1/2)=3 and 4^(1/2)=2 (here I'm assuming a gamma of 1/2). This means that, while the actual change in intensity is more than 50%, based on the pixel values you only get 30%. Ideally this is solved by using the raw sensor data (assuming that is linear with intensity), but otherwise you have to calibrate for this.
This calibration gives you a function that converts a pixel value to an intensity: I = g(v). This is independent of the wavelength.
Here, you are calibrating the ccd sensor with additional processing performed in the camera. This calibration could be performed outside of the spectrometer and might be approximately constant for the same type of camera, assuming the exact same settings are used. This brings up a critical point: you need to be able to operate the settings of the camera manually. The settings that I have so far encountered that need to be controlled are (auto)exposure, gain, (auto) white balance, saturation, sharpness, contrast.
I have a few logitech webcams that allow for manual control in Windows, but only via their own software or through Matlab. I haven't found an easy way to do this via Processing, for instance. I think this will be a critical step to solve for both webcams and mobile cameras. Not being able to perform this calibration will severely limit the applications for which the spectrometer can be used.
I'm currently looking into this type of calibration using Matlab and a technique inspired by HDR photograpy where several pictures are taken of the same scene at different exposures (see http://www.pauldebevec.com/Research/HDR/debevec-siggraph97.pdf). I will post back here once I have results.
3. Relative intensity calibration
Here, you're looking for a wavelength-dependent scaling factor.
This can be obtained by measuring a broad band light source and comparing this with its known spectral distribution, for instance using a tungsten light bulb (see http://eprints.lancs.ac.uk/6736/1/inproc_326.pdf and http://jethomson.wordpress.com/spectrometer-articles/system-function/). For this you don't want narrow and intense peaks.
4. Radiometric calibration
A radiometric calibration can be done using an additional irradiance sensor (see http://jethomson.wordpress.com/spectrometer-articles/radiometric-calibra...). This calibration will give a single calibration factor with which the whole spectrum should be multiplied.


Comments
I wonder if it would be possible to calibrate wavelength against the sensor's own sensitivity to R/G/B light of different spectrums? If you provided the spectrometer with a white / gaussian source, it's going to display peaks in different color channels that correspond to specific wavelengths.
Hi,
When speaking of "calibrating wavelength", what Wiebew is referring to is the mapping of the colors of the rainbow onto the horizontal axis of the webcam. The RGB filters that permit color imaging with the 3 sets of CCD detectors do not really play a part at all in this calibration.
This "spectral" calibration is typically done in the lab using the sharply defined first order peaks of mercury and argon. The lamps are simple but quite expensive. The project uses common CFL lamps which contain both gases, but also possibly some others along with phosphors that might mask some peaks or make definition of others error prone. I don't know if this is an issue at present. The CFL lamp is certainly a good solution for most users.
In much more expensive spectrometers, a line sensor is used. A reflective diffraction grating and mirror transform incoming light into a beam that looks like the Pink Floyd "Dark Side of the Moon" album cover. The mirror is then adjusted to position the beam onto the array.
In this innovative new spectrometer, the advantage of mass production gives PublicLab the camera and computer interface for a few bucks. The camera has many more pixels in the vertical axis than we need, but we don't mind. Using a transmissive grating (piece of a DVD) eliminates the mirror and allows placement of the grating right in front of the camera.
If you understood all that before and were asking if it might also be possible to measure the intensity of discrete wavelengths with any accuracy using the color filters, the answer is absolutely not.
BTW "gaussian" light refers to theoretical wave packets. A gaussian beam refers to the energy distribution, or shape, of the beam. A white light resembles a black body curve in spectral energy distribution.
I'm saying "we", but I only just came on board and have contributed nothing but a few ideas so far. I hope this helps broaden your understanding.
Post new comment