Tuesday, August 31, 2010

NIO's Observer Function

I wanted to check how NIO translates exposures into B&W pixel values and I found that I needed to set the current through the RS green LED equal to 3.16 mA to cover a significant portion of the exposure curve. The slide viewer diffuser was placed between the LED and the camera to spread out the light as evenly as possible. The ISO was set to 100 and the f-Number, fN, was initially set at 2.8 while the exposure time was varied from 1/8 sec. to 1/2000 sec. I still needed more data so I left the exposure time at 1/2000 sec. and increased fN in increments from 2.8 to 8.0. The peak values for each image was then determined. The smooth curve is a fit which matches the data while keeping peak value at 255 and dropping to zero for large EV values.

The observed curve doesn't appear to be the power law with a gamma of 2.2 as was assumed earlier. We can refer to the exposure curve as NIO's observer function. It's part of a personal equation.

Sunday, August 29, 2010

NIO Does a Little Stargazing.

NIO managed to get in a little stargazing this evening. The Big Dipper was towards the North-West and NIO was able to capture an image with the maximum aperature available. The three stars in the upper left form the handle and Dipper itself is to the lower right. The two bottom stars are just barely visible but the star where the handle and dipper join is too faint to be seen at all.

click to enlarge

The stars were brightened relative to the background using a power law with the power, p, equal to 1.6. You may have to click to enlarge the photo to its original size.

The Effect of a Diffuser in Front of the LED

A diffuser can help spread out the light more evenly across the projected beam of light emitted by the LED. To demonstrate this I place the diffuser of an old slide viewer next to the LED.

I then placed the frosted glass plate in front of the slide viewer diffuser and took a picture to show its angular distribution.

A spotmeter indicated that the center of the distribution was EV = 8.1 which corresponds to a luminance of 38.2 cd/sq meter.

So the diffuser spreads out light more evenly and can compensate to some extent for the flaws of the light source. It may also widen the viewing angle of the LED.

The LED's Luminous Emittance

The LED's emissions are not the same in all directions. To capture this I placed a frosted glass plate in front of the LED at various distances from it and took a picture of the illuminated plate. As the pattern gets larger farther away from the LED one can make out the shape of the luminous square inside the LED.

3 cm

9 cm

15 cm

There seems to be a "halo" which surrounds the brighter center of the pattern and grows linearly with distance.

The edge of the halo marks a cone which bounds the emitted light. The angle between the lines common to a plane cutting the light cone in half and the light cone is 18°. At larger distances the central pad where the whisker makes contact interferes with a uniform distribution of light.

Saturday, August 28, 2010

A Standard Candle?

The power law for the luminous intensity indicates that a current of 25.5 mA through the LED will produce an intensity of 0.50 cd. So two of them with the same current flowing through them should produce an intensity of 1.0 cd if both LED have the same characteristics. An LED with a square of luminous material whose side 1.25 that of the one in the measured LED would be capable of producing 1 cd at the same level of emittance. If the internal resistance is the limiting factor on the maximum current then reducing it will allow more light to be produced by the LED before failure and its V-I characteristic would be closer to that of an ideal diode.

Friday, August 27, 2010

Summary of the Characteristics for the RadioShack 5mm Green LED

Here is a summary of the characteristics for the RadioShack 5mm Green LED:

I_v is the luminous intensity in millicandelas as a function of current. I couldn't verify the 630 mcd value at 30 mA so it should be considered "nominal".

The measurements suggest the possibility that LEDs might be used as a convenient reference light source for photographic purposes and other uses. The internal design could be modified to provide a square source of known size and therefore known luminance. Perhaps the contact pad moved to one side and the perimeter of the luminous material covered to produce a convenient photographic source. A flat plastic covering would probably alter the apparent size of the source slightly. Accurate measurements of the characteristics could be supplied with the reference LED for the convenience of the user.

A Peek Inside the LED

After turning down the intensity of the light from the LED was able to get a peek inside and could see where the light was coming from. There is a square piece of luminous material with a dark patch in the center. The dark patch appears to be the contact point for a thin wire (whisker) coming down from the top left.

I had a bit of trouble with the focus on this image. I adjusted the image to give the best view of the square. I could see it more clearly by eyeball but I am myopic so I can focus closer than the average individual and get a little extra magnification in addition.

Thursday, August 26, 2010

Relative Luminance vs Current

To measure the light emitted by the green LED I took a series of three pictures for each value of current using an EV bracketing of plus or minus 0.3 EV and adjusted the exposure so that the spot meter indicated that the exposure of the LED was at about +1.0 EV. The image was reduced to B&W and the pixel values were decompressed. The total "luminance", L, for each image was determined by summing the values for each pixel and the three bracketed luminances for each current setting were interpolated to find an EV correction which set log L equal to a central value of 6.8.

The EV for each current was computed from the exposure settings of the central image and the adjustments were made to get the EV which "equalized" the exposure. One can manipulate the formula for the EV to show that the relative flux, φ, is equal to 2 raised to the power of the EV.

The plot of the relative flux vs the current in mA proved to be linear on a log-log plot and the slope and intercept were computed.

So we have found the relative amount of light emitted by the LED as a function of the current in mA. Conversely, for a given relative flux we can compute the current required and use a milliammeter to control the LED light output.

Wednesday, August 25, 2010

The Green LED's Spectrum

A test exposure of the green LED's spectrum with the Kodak Z981 produced this image.

I used a white index card to illuminate the scale with a Sylvania Daylight plus CFL and produce a faint fluorescent spectrum just under the scale for reference. The lines visible are at 546.5 nm and 611.6 nm. The LED has a continuous spectrum over a limited range.

New Observer Onboard

I'd like to introduce everyone to my new lab assistant. This is NIO short for Naive Impressionist Observer. NIO will be doing most of the observing from now on and will be handling a lot of the record keeping tasks.

NIO could not transfer images directly to my computer either through the cable link or the SDHC flash memory so I had to purchase a Dynex card reader to act as translator. NIO is a Kodak digital camera designed in Japan and made in Vietnam. It appears to be an updated version of the Sony Cybershot with better aperature control.

The Kodak Easyshare Z981 is a PASM Auto Exposure camera with program mode, aperature priority, shutter priority and a manual mode. The manual mode allows one to control the exposure by independently setting the f-stop, shutter speed and ISO speed. In the image above one can see the spot meter reading (bottom row center) which helps in the selection of the exposure settings. I had to consult the online Extended User Guide in order to find out how to change the settings. There is also an optical zoom for distance shots.

Tuesday, August 24, 2010

Equivalent Circuit for an LED

The deviation of the measured characteristic from an ideal diode at higher currents can be explained by an internal resistance within the diode. If one allows for an internal resistance one gets an almost perfect fit with the ideal diode equation for all values of the measured current. So the diode equation does appear to work.

The results suggest the following equivalent circuit for a real diode. There appears to be an interval voltage source, V0, an ideal diode characterized by I0 and the thermal voltage and an internal resistance.

I do not know enough about the internal structure of the diode to explain the internal voltage barrier. It may to due to a Fermi energy which is associated with the chemical potential, μ, a measure of the free energy of the charge carriers in the diode.

Monday, August 23, 2010

Comparison of the LED Characteristics With the Diode Eqn

The diode equation did not give a good fit to the LED characteristics. The fit that I got for the smaller values of current indicated that a voltage, V0, needed to be subtracted from the measured voltage. The intermediate values fit better if a correction to the measured voltage, V, for the IR voltage drop across the milliammeter was made. The maximum IR voltage drop was 0.06 volts. The larger currents still tended to deviate from the modified diode equation.

I do not know why V0 is needed. It could be that light produces a contact electrification of the junction in the LED.

Sunday, August 22, 2010

Measuring the Characteristic Curve for an LED

Last month I was forced to break hard to avoid hitting a doe on the road at 3 am one morning near Oakhurst, CA and the developed a "shimmy" or jerking motion in the steering afterwards. I took the car in to have the front end realigned and put new tires on and now its back to normal.

While waiting for the repairs to be done I picked up some LEDs at RadioShack. There wasn't much information on the LEDs except forward voltage 2.1 V, current 30 mA, luminous intensity 630 mcd, and wavelength 565 nm. So I tried to measure the characteristic curve using two 1.5 V AA batteries, a resistance box and a digital multimeter to measure the current but the curves proved to be useless even though I corrected for the voltage drop across the resistance box. I decided to get a second digital multimeter and this time measured both the voltage across and current through the LED. The results were better.

The function for the characteristic curve is empirical and gives the current in milliamps. The -1 is needed so that the current will be 0 mA when the voltage is 0 V. A cubic exponent gives a good fit over the range of the voltages measured.

Limits of Detectability

One can use analytical instruments to make rough measurements of the chemicals in a sample of water but adjustments need to be made to these measurements to compensate for complicating factors. Fluorescence spectroscopy is capable of measuring quantities in a substance with concentrations down to the level of parts per billion. Samples cells are compared with standard cells of known concentration. When one is working near the limits of detection (LOD) the accuracy of the results may suffer. When a substance is present below the LOD false negatives are likely. With a bulk sample there is also the possibility of interactions between the molecules present which will alter results somewhat.

One encounters similar problems with human perception. For the eye the limit is the dark adaption threshold. At low light levels an image becomes pointilistic and scintillating. The eye is not equally sensitive to all colors of the same intensity and this is the subject of colorimetry.

Friday, August 20, 2010

Recommended Reading

For more information about Quantum Optics and Fluorescence Spectroscopy the following references may provide some background material.

Petroleum in the Marine Environment: UV Fluroescence Spectrometry

Laser Experiments for Beginners by Richard N. Zare

What Would a Critical Analysis of the Oil Spill Require?

The goal of the government with respect to the determination of the extent of the spill would be to arrive at an unbiased estimator of the amount of oil released into the environment. BP is probably entitled to due process when making this estimate. A critical analysis of the raw data would try to remove any systematic error in the process and try to be as exact as possible. An initial analysis may not have to be so critical to provide guidance to the responders. But the lack of a baseline study certainly would complicate the arrival at a final conclusion. Perhaps they should be required in the future.

Rep. Markey asked for a formula used in the oil budget calculator. Fluorescence spectroscopy which was used to measure the concentration of the oil near the well falls under the domain of Quantum Electrodynamics. To determine the transition rates one needs to know the oscillator strength function which is related to the Einstein coefficients. One might be able to adjust the spectroscopy data by subtracting the distribution for Rayleigh scattering to arrive at a better estimate. A study of Raman scattering might confirm results. The analysis requires expert knowledge.

Thursday, August 19, 2010

The Scattering of Light by Small Particles

Light is scattered by small particles and the effect is dependent on the wavelength of the light used. If the size of the particles is much smaller than the wavelength of the light then Rayleigh scattering applies, otherwise, Mie theory is used. Light absorption can also be used to measure the concentration of a solute in a solution. The formula used is known as the Beers-Lambert Law. Data collected by these means can be used to determine the concentration of the oil particles dispersed in the water column of the Gulf in the area of the oil spill. The availability of more than one method allows cross checks to be made on the results. The method used in the reports mentioned previously to measure the presence of oil in the water column appears to be spectrofluorometry. The results of this method can be complicated by Raman scattering in which changes in the frequencies of the light emitted occur and Rayleigh scattering. Rayleigh scattering is just elastic scattering of a photon of light off a molecule and doesn't involve fluorescence in which the molecule absorbs the energy of the photon and then re-emits it. If one is not careful one can get false positives for the presence of a particular molecule. One needs to compare results with an uncontaminated sample or observe changes over time.

An interesting effect is that of critical opalescence which can be seen in this YouTube video.

Gulf Oil Spill & Seafood Safety Committee Hearing

Rep. Markey today conducted a hearing into the safety of seafood from the Gulf as a consequence of the BP oil spill. This hearing is currently available online at C-SPAN.

The seafood sampled were deemed to be safe for human consumption. The main concern was the presence of polycyclic aromatic hydrocarbons (PAHs). The Oil Budget referred to during the hearings indicates what happened to the spilled oil (summary). A more technical report discusses the Oil Budget Calculator about which Rep. Markey asked for more detail on the formulas used. These reports on which the discussion is based are part of a ongoing process conducted by a collaboration, the Joint Analysis Group and the conclusions are not yet final.

Saturday, August 14, 2010

Can We improve on the Digital Color Camera?

During the early days of color television when people still had B&W televisions both signals had to be transmitted so a quadrature modulation system was used to send monochrome, M, and two differences I and M. The monochrome channel was the luminance Y and a transformation from RGB to Y was done using the following equation but the assumption was the use of illuminant C which is north sky daylight.

(The quadrature system is also used for stereo.) So the luminance is definitely dependent on the wavelengths of the light illuminating a scene.

One wonders if it is possible to improve on the color camera. Digital color cameras use either the 3CDD method or Bayer filters to capture the RGB information. But there are other color spaces such as CMYK. A variant on CMYK might be RGBY in which an unfiltered image is used instead of a second G image. A camera using RGBY would be able to take B&W pictures. One of the reasons for using M/I/Q in color television was the reduction in bandwidth needed to store an image. Something similar might improve image compression for storage. An opponent color space is also a possibility.

I still have some doubts about the heights of the peaks on the camera spectrometer. I assumed an equal energy white for the illuminant which has equal amounts of R, G and B and so each coefficient of the Y conversion formula is then 1/3. Daylight illumination is close to this. The light from the fluorescent bulb is whiter than normal. So the assumption of an illuminant affects the conversion process. And the old formulas will no longer work if new primaries are being used.

Friday, August 13, 2010

Using Exposures Instead of RGB Values

The exposure of a pixel represents the quantity of light captured by it when a picture is taken and presumably this is gamma compressed to give the RGB values. So before adding these values together they would have to have the gamma corrections applied to them. This would include the values used for averaging over the a number of pixels to smooth the results. In Fink's Television Engineering Handbook (1957), Ch. 4, p. 9, which uses the CIE 1931 color system, it is stated that at each wavelength that a match is made the luminance of a spectral line is equal to the sum of luminances of the RGB components. The implication is that we just have to add the gamma corrected RGB values to get the total illumination. Division by three doesn't affect the relative illumination of a pixel. The result is then closer to the response that one would expect for the eye being greatest for the 546 nm spectral line of mercury (Hg).

This plot suggests that the color temperature might be higher than data sheet indicated. It is similar to that of the "narrow band" illuminants F10-12 and seems to lie between F12 and F11. The bulb used was not exactly the same as those listed in the datasheet.

Thursday, August 12, 2010

CFL Spectrum with Gamma Correction

The vertical scale of the intensity for the CFL spectrum found in the last blog is nonlinear due to the fact that the camera uses gamma compression to raise the values at the bottom of the scale making the image more sensitive to lower light levels. The images have to be gamma corrected by the display device. The value of gamma that was agreed upon for sRGB is 2.2.

The plot above is for the same CFL spectrum found previously but with a gamma correction applied to the vertical scale. The relative heights of the peaks are probably dependent on the formula for converting the RGB values to a B&W value. The function that my computer uses to convert a color image to B&W shows a stronger response to the G values which one would expect since the eye is most sensitive to 555 nm. I probably need to look for a better conversion formula.

edit: The eye's response to light of different wavelengths is measured by the luminosity function. The RGB values are determined by the color matching functions. All four depend on the illuminant since the spectral power density is a function of wavelength. The conversion formula used may assume a standard illuminant.

Improving on the Accuracy of Your Spectrometer

One can use compact flourescent lightbulbs (CFLs) to check the accuracy of one's spectrometer and make the necessary corrections. The CFL that I used was a Sylvania Daylight Extra mini 100 which is rated at 1600 lumens, 23 watts and has a color temperature of 3500 K and has a mercury spectrum. Instead of a continuous spectrum like that in incandescent bulbs that of mercury consists of discrete lines.

Using the scale of the spectrometer one can find a line which converts the horizontal number of the pixel, x, to a wavelength, λ, measured in nanometers. One can get the intensity of the lines by using the pixel values of a B&W image or convert the RGB values for each pixel using the formula* I = (R + G + B)/3 and then measure the x values of the peaks using the conversion formula to get measured values of the wavelenths, λ_meas. The reference wavelengths were obtained from a Wikipedia plot of the flourescent light's mercury (Hg) spectrum and these were used to obtain a formula for the corrections, Δλ, for the measured wavelengths.

The errors in the positions of the lines ranged from about -15 nm to -35 nm depending on the value of the measured wavelength.

One can then use these formulas to calculate a corrected scale for the wavelengths of the mercury spectrum.

I was also able to compensate for a slight tilt of my camera relative to the spectrum by averaging along a line slightly shifted from vertical which improved the resolution enough to show an indication of the multiple lines just below 600 nm. This result can be compared with the spectrum for a CFL with a 3500 K color temperature in a Sylvania technical factsheet for their compact flourescent bulbs. Narrowing the slit of the spectrometer slightly by taping a thin piece of cardboard from the light bulb carton over it reduces the intensity of the spectrum and also helps to improve resolution slightly.

*This formula seems to be more accurate than the one previously used involving the squares of the RGB values.

Tuesday, August 10, 2010

Adding Violet to the Spectrum

Taking a picture of a spectrum with a digital camera doesn't guarantee that you will capture a complete spectrum. Some colors like yellow and blue do not show up because the power spectrum of the light is fairly uniform over the range of wavelengths present. I narrowed the slit on my spectrometer and took a picture and as you can see the colors yellow and cyan are muted while magenta is missing entirely.

The reason appears to be that the camera is not sensitive enough to red light below a wavelength of 500 nm. Each pixel of an RGB image has values of R, G and B ranging between 0 and 255 for the colors red, green and blue respectively. One can add a synthetic violet to the image by replacing the R value by 4R if the B value is greate than the R value but only to those portions of the image that you want to correct. This effectively makes the R image more sensitive to violet light. The changes are shown below.

In general one probably needs to be more careful about conditions and changes made to the image. The change worked for this example but the same changes would also alter other colors like the white in the scale above the spectrum.

Friday, August 6, 2010

Two Steiner Problem and Soap Film Solution References

I was looking through James Newman's The World of Mathematics, Vol. 2 today and came across the soap film solution to the 5 point Steiner Problem. The original reference is What is Mathematics? by Richard Courant and Herbert Robbins.

Initial Results on the Diffusion Experiment

I have done an initial experiment on the diffusion of food coloring in Knox unflavored Gelatin. I stirred 5 ml of gelatin into 250 ml of warm water in a measuring cup and then heated the solution for 90 seconds in a micorwave oven. After stirring again I poured most of it into 6 90mm Petrie dishes using a straw as a guide and then chilled the mix in the refrigerator for a few hours. My first attempt to let the food coloring gel to diffuse failed because I left it sitting on the light box and it ended up liquifying again. On my second trial I used a tooth pick to poke little globs of coloring gel into the gelatin and returned the dish to the refrigerator. For this experiment I used FD&C blue 1 from a tube of Betty Crocker Classic Gel Food Colors also contains FD&C red 40 and FD&C yellow 5.

I checked the Petrie dish some time later and the spots of dye showed a noticable amount of diffusion. So I made my first observation which was the image above. I cropped the original 1600 x 1200 image to obtain to get a 150 x 150 image of the lower right spot.

To analyze the results we need some math. For a one dimensional problem the probability distribution function is p(x). This is also known as a Gaussian function. When one calculates the expected value of the square of the deviation from the central value one gets "σ squared" which is the square of the diffusion length. This turns out to be half the devisor in the exponent of e. The numerical factor in front is needed so that the total probability is equal to 1. Again, starting with a Gaussian function for the 2 dimensional case one finds that the expected value of the square of the deviation from the central point. This time it turns out to be just "σ squared" or the square of the diffusion length and so we set this value equal to the disivor in the exponent of e and need a different numerical factor so the total probability equal to 1. One has to add a constant term and multiply the probability distribution by a numerical factor in order to fit the image of the diffused blue dye. The formula below was used.

The red portion of the image is the least responsive to blue light so I subtracted the values of the pixels from 255 to get a measure of the absorbtion of the light. The 3D surface plot of the altered R values, R', shows a Gaussian distribution. This distribution was used to obtain a fit to the data. The results are shown above the surface plot.

The x and y values in the image are numbers which give the location of the pixels. To convert the diffusion length into a distance measure on has to use the width of the Petrie dish to obtain a conversion factor. The diameter of the innermost ring of the bottom of the Petrie dish was 83.5 mm which corresponded to 968 pixels. This gave a value for the conversion factor of 86.26 nm/pixel.

edit: There was a typo in the expression for the expected value of the one dimensional diffusion case. I had initially used λ squared as the divisor in the exponent of the Gaussian function. It's now been fixed. One could call the standard deviation the "deviation length."

Wednesday, August 4, 2010

Sony DSC S50 Response for Normal Exposure

The image of the spectrum for incandescent light looks closer to normal if no exposure bias is used. The camera's RGB color model was designed to work this way. The colors missing from the spectrum are on the left and right ends. The eye see a faint violet at about 400 nm and a richer red about 750 nm. To me there appears to be less yellow and cyan in the true spectrum. The CIE 1931 Color Space which models a standard observer shows more of a "red response" to blue light which seems to be missing from the camera's response.

Note that the RGB response curves are clipped near the peaks giving a flatter response.

The result is that the intensity has two peaks in it corresponding to yellow and cyan which are brighter by nature. The colors red, green and blue are the corners of the color cube which are closer to black while yellow, cyan and magenta are corners closer to white and hence brighter. Physically the energy density at each wavelength in incandescent light is about the same for thermal radiation at 3000 °K and one would expect a similar response at all frequencies. The eye is most sensitive to green and one would expect a stronger response there.

The conclusion is that the camera does not respond in the same way to light that is underexposed as it does to a normal exposure. The colors in shadows may be shifted somewhat. One does not see the colors yellow or cyan in the underexposed spectrum. The underexposed images give a better indication on how the RGB filters work.

edit: Photopsins are the protein-pigment complexes which determine the human eye's response to light.

Tuesday, August 3, 2010

Sony DSC-50 Spectral Response to Incandescent Light

Recently I've been trying to measure the my digital camera's response to incandescent light. The camera is a DSC-50 Cybershot with which I tried to take pictures of the spectrum produced by a 100W incandescent light bulb seen through a Classroom Spectrometer from Edmund Scientifics. At first the images came out overexposed and the peaks of the sensitivity curves were clipped at the peaks. But I was able to tweak the settings on the camera to get a usable image.

The camera setting were 1600x1200, autofocus, spot metering and EV -2.0 (bias) for which the camera selected f/4.0 at 1/60 sec. Averging the RGB pixel values vertically along the spectrum gave the following response curves from the red, green and blue images. The averaging helps smooth the curves.

These RGB curves can be used to compute the corresponding intensity curve, I.

One can compute the intensity, I, from the RGB averages by using the following formula. The formula gives the same curve that one gets by converting the color image into a black and white image. Division by 3 is needed so that the intensity of white, R=255, G=255, B=255, is also equal to 255.

The light produced by an incandescent light bulb is primarily thermal radiation produced by a heated filament. The color temperature of the light is about 3000 °K and so it has more red light present than blue light. This may be why the red peak is higher than that of blue.
edit: (12 Aug 2010) I made an error here. The values of the B&W image are the average of the RGB components.

Monday, August 2, 2010

Other Mechanisms for the Dispersion of Oil

The formula for the diffusion coefficient posted a few days ago showed that the rate of diffusion depended on the particle number density of the medium. This indicates that particles would diffuse faster in the air than in water since it is less dense. Evaporation probably played a significant role in the dispersion of the volatile organic compounds in the oil floating on the surface of the ocean. The molecules that are removed through evaporation can end up being adsorbed onto the surfaces of solids or broken down into simplier molecules through chemical decomposition via oxidation, thermal decomposition or photochemically through photolysis. The means whereby the molecules are broken down in seawater my involve similar processes as well as digestion by micro-organisms and other biological organisms.

The big question now is how much oil was processed by each mechanism and what is still present in and on the water and above the its surface. The fraction of the oil present in the water will probably have a different biological half-life for different layers of the ocean. A long half-life would help better distribute the effects of the oil spill over time as well as distributing it over a large volume perhaps reducing bioamplification by allowing more time for the elimination of toxic substances.

edit: A question that should be asked under the circumstances of the oil spill is, "How can we buy time for an ecosystem?" Another path that some of the oil followed was the burn off on the ocean surface.