09-04-2012 08:20 AM
Hi there,
I work as a summer student and am supposed to write a program to measure different spectra (finding peaks + fwhm). I use the USB2000+ from OceanOptics with the Omnidriver+SPAM package.
Sadly I have no experience neither with LabVIEW nor with programming at all.
I started with some LabVIEW tutorials and after that I created a .vi regarding to the OceanOptics Omnidriver and Labview tutorial ( http://www.youtube.com/watch?v=tT5C43D3rR )
Now I can measure the spectrum and find my peaks + wavelength, but I don't know how to get the FWHM (or rather the wavelength) of my peaks.
Is it possible to get the FWHM value and the wavelength with Omnidriver and LabVIEW or is there an easier way to achieve this?
BTW I am using LabVIEW 8.5
Attached you can find .vi's I tried to work with as well as a picture of a test spectrum
I very much appreciate your help.
Jens
09-05-2012 08:54 AM
Hi Jens,
Thank you for using National Instruments forum.
I had a careful look at the different VIs proposed in LabVIEW. You do not have a VI, which can directly give you the FWHM value.
You need to program yourself the calculation.
I wrote down here the different steps to find the FWHM:
1. Find the peak with the "Threshold 1D array" VI with max/min array function. But I think you already did it.
2. Look for the Max index (Ind_max)of the Max
3. Search the array for the next value of half the max. Look for its index (Ind_1).
4. Calculate the difference between the wavelength values corresponding to Ind_max and Ind_1 and multiply by 2 to have the FWHM.
It works if you have a symmetrical spectrum.
Hope that helps.
Keep me updated with the evolution of your application.
09-07-2012 02:45 AM
Hi Julien,
first of all thank you for your advice.
I tried it out and in case I have symmetric peaks it works well.
For the case I have non symmetric peaks I did the same with reversed the arrays to get the wavelengths.
So right now my VI will automatically detect the highest peak and analyse/calculate its FWHM. But in case I have more than one peak and do not want to detect the highest one, is there a way to set limits to get just one peak (the peak I want to analyse)? (For example I have 3 peaks at 940nm, 1014nm and 1090nm. The peak at 1090nm the highest one, but I want to analyse the peak at 1014nm)
Thank you in advance.
Jens
09-07-2012 03:14 AM
Hi Jens,
Could you tell me the LabVIEW 8.5 package you have? Do you have the base package or the full development system?
If you have the full development system, you can use the Peak Detector VI.
http://zone.ni.com/reference/en-XX/help/371361D-01/lvanls/peak_detector/
If not, you need to program yourself the peak search. I can give you some clues.
Regards,
09-07-2012 03:32 AM
Hi Julien,
thanks for your fast answer. I use the full development system at work. At home I just have a Students Version.
Thanks, then I will try out the Peak Detector VI, but it would still be nice to give me some clues to program the peak detector by myself to try it out at home.
Thank you,
Regards
Jens
09-07-2012 03:40 AM
Hi Jens,
The NI LabVIEW Student Version has the same functionality as LabVIEW Full Development System.
http://sine.ni.com/nips/cds/view/p/lang/en/nid/210866
Keep me updated with the evolution of your application.
Regards,