LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Gaussian and Lorentzian peak detection for spectroscopy

I am trying to automate some data analysis for a large number of Raman
spectra, and would like the option of using a Gaussian or Lorentzian peak
fit (the included VI is some sort of a parabolic fitting algorithm). Is
there a way to do this with any of the VIs in the full development system
(or has anyone already made such a VI), or am I going to need to just write
some C code and use the code interface node?
0 Kudos
Message 1 of 3
(4,953 Views)
Hi,
as far as I know there is no such approximations in LV. We do something like you need in analysis of femtosecond pulse durations. So I can advise you the next algorithm:
1. I assume that you now the distribution of your experimental Raman spectra along the frequency - S(f)
2. You have to clculate the main frequency of your spectra
F0=integral(S(f)*f*df) / integral(S(f)*df)
3. You have to calculate the dispersion (HWHW) of your spectra
dF= integral((f-F0)^2*S(f)*df) / integral(S(f)*df)
4. Now you know the main frequency and the width of the spectra and the only thing you need is to insert this values into the formula of your approximation functions
Gauss(F0, dF, f)=A*exp((f-F0)^2/(2*dF^2));
Lorentz(F0, dF, f)=A/((f-F0)^2+dF^2));
5. The last thing is the det
ermination of the amplitude of your approximation spectra - A. Yuo can do it from the condition of energy conservation -
integral(S(f)*df)=integral(Aproximation(f)*df);

This is just a mathematics and you can make all the calculations in LabVIEW without using of C code.

As for the gaussian approximation I can give you another advice to calculate the logarithm of your spectra and approximate the function with parabola.

Good luck.

Oleg Chutko.
0 Kudos
Message 2 of 3
(4,953 Views)
Scott Williams wrote:
>
> I am trying to automate some data analysis for a large number of Raman
> spectra, and would like the option of using a Gaussian or Lorentzian peak
> fit (the included VI is some sort of a parabolic fitting algorithm). Is
> there a way to do this with any of the VIs in the full development system
> (or has anyone already made such a VI), or am I going to need to just write
> some C code and use the code interface node?

On my web site you can download a routine that makes a fit to a
Gaussian peak. It first estimates the width, offset, amp., etc, so that
the non-linear fit has a chance to converge. You may be able to
generalize this to do a Lorentzian as well.
Go to www.originalcode.com, then click on Example Code, Utilities,

and Downloads.

Dave
-------------------------------------------------------------
David Thomson 303-499-1973 (voice and fax)
Original Code Consulting dthomson@originalcode.com
www.originalcode.com
National Instruments Alliance Program Member
-------------------------------------------------------------
Research Scientist 303-497-3470 (voice)
NOAA Aeronomy Laboratory 303-497-5373 (fax)
Boulder, Colorado dthomson@al.noaa.gov
-------------------------------------------------------------
0 Kudos
Message 3 of 3
(4,953 Views)