GregroxMun

Spectrum Analysis Notes

Sep 26th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.92 KB | None | 0 0
  1. Spectrum Analysis Notes
  2.  
  3. My intitial plan was to split a spectrum rendered in RGB into Hue, Saturation and Lightness channels. Disregard the S channel, I'd graph Hue and Lightness onto a plot to get the spectrum curve. I immediately realized upon splitting the channels that this wouldn't work, as photographs of spectrums may make red into a pink color, which is on the opposite end of the hue spectrum despite really representing red or orange. And I also realized it was unneccesary, if you have a spectrum you already have a hue (wavelength) axis.
  4.  
  5. So now it's a simple matter of taking a one pixel tall gradient out of the spectrum, extracting the lightness channel, and graphing the resulting curve. My first test was to graph out, on graph paper by hand, a 64x25 graph of a HPS spectrum found online. Vertical axis was greyscale lightness divided by 10, horizontal was wavelength, though chunked down to a scale that I could get through quickly enough. The light curve that resulted was not obviously similar enough to the spectrum that it took some time to decipher it. Part of the problem was the low precision of the measurement. Upon inspection of the non-rescaled spectrum, there was a much clearer peak in the yellow.
  6.  
  7. After a lot of time, I've verified that while there's a few problems, I have graphed an HPS spectrum. What I really need is a way of taking a grayscale spectrum and turning it into a plot automatically.
  8.  
  9. After I recieved the email containing some more spectra to play with, I discovered something--converting the spectrum to grayscale instead of using the lightness channel results in a spectrum which is much closer to what we see in graphs found online, with dimmer blues and brighter yellows in the HPS. Further experimentation shows that Lightness value is in fact what you want when you're looking at blue lights. One important factor then is determining which is more correct, Grayscale or Lightness, or something in between?
  10.  
  11. One important fact I've found is that the lightness and grayscale spectra of the Millis and Auto LEDs were very different, but not in the way I expected. The Millis LED was much dimmer in the green region while the Auto LED was much brighter. The difference may be entirely based upon the differences in the image, the spectrum for the Auto LED was very overexposed. As a rule of thumb, a spectrum must not have any white in it--we lose spectrum data for that part as it's cut off.
  12.  
  13. Currently lacking a good method of turning an image into a graph, I've resorted to a silly method indeed. I take a square shaped vertical gradient going black to white bottom to top, and then take the horizontal spectrum gradient and stretch it into a square, and then copy the spectrum onto the greyscale gradient with the clone tool using the lighten setting--the tool will only draw over a region darker than it. With that it is possible to produce the shape that the spectrum graph would have--with some added imprecision.
Add Comment
Please, Sign In to add comment