LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Gaussian Peak Fit

I currently have labview 7.1, but i need to use a particular function in labview 8 that is - Gaussian Peak Fit.vi Is there anyway to program the same function in labview 7.1 or is there any alternative to Gaussian Peak Fit.vi in labview 7.1 ? I have an array of numbers and i need to find the best gaussian fit. Thanks for your help.
0 Kudos
Message 1 of 10
(7,463 Views)
Here's a simple example that fits a single Gaussian or Lorentzian (selectable). Have a look at my old post here.

Download Gaussian/Loretzian Fit Demo. 🙂

Let me know if you have questions.

0 Kudos
Message 2 of 10
(7,456 Views)
Thanks for that, I think it will be of help.

BJ_phy



0 Kudos
Message 3 of 10
(7,418 Views)

Hello, I have exactly the same trouble. I will try with the Altenbach solution.

thanks- 

0 Kudos
Message 4 of 10
(6,944 Views)

ikarus wrote:

Hello, I have exactly the same trouble.


What is the "same"? Do you also have 7.1?

 

Let me know if you have any questions. My example is relatively primitive.

 

0 Kudos
Message 5 of 10
(6,936 Views)

Hello,

Yes. I have LabVIEW 7.1, and I need to do a Gaussian fit for an array of data. I did it in LabVIEW 8 with the VI "Gaussian Peak Fit", but it's imperative for me to do this in LabVIEW 7.1.

i'm trying to adapt your programming to my necessity.

 

0 Kudos
Message 6 of 10
(6,922 Views)

The fitting works fine, but now I need to build the Gaussian function with the coefficients, and i don't know what is the form of the function.

In the Labview 8 Help appears the formula shown in the picture below.

0 Kudos
Message 7 of 10
(6,896 Views)

I use the "spectroscopist" definition where the width is defined as "width at half maximum". This is more approriate for my use.

 

NI seems to be using the "statistician" definition, where the width is defined in terms of a "standard deviation".

 

You can easily rewrite my model subVI to redefine this parameter. Most likely, you also want to add a few inputs such as the x-values, etc. as needed. (My demo is extremely stripped down and assumes a fixed set of X values as x=0..255.)

0 Kudos
Message 8 of 10
(6,884 Views)

Dear altenbach,

 

Can you explain why the gauss function is exp(-0.693*(1+((x-mean)/std) **2)  instead  exp(-0.5*((x-mean)/std)**2)

 

Thanks

0 Kudos
Message 9 of 10
(6,660 Views)

I'd use the L-M non-linear fit. I would recommend a model equation of

 

f(x) = a * exp(-(x - mu)*(x - mu)/(2 * sigma * sigma)) + slope * x + c

 

Just feed initial guesses and works great for a gaussian fit that might not be necessarily symmetric !


Kudos are the best way to say thanks 🙂
0 Kudos
Message 10 of 10
(6,622 Views)