LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Gaussian Peak Fit and Nonlinear Curve Fit on small data differ from Origin Peak fit

Solved!
Go to solution

Hi all,

I am developing a program in which I have to fit Gaussian curve on only 4 or 5 data points. When I am using Gaussian Peak Fit or Nonlinear Curve fit, it linearly connects all the points while other fitting software like Origin is fitting Gaussian curve on the same set of data I have attached two images One is from Labview with Gaussian Peak Fit and NonLinear Fit and other is from Origin.

Data is

X                       Y

799.09857        257
912.25256        641

1026.00366     1516
1137.92871     1118
1253.43713     329

Labview user
Download All
0 Kudos
Message 1 of 5
(7,268 Views)

That looks like a plot of the input data.

 

When I run it with your data I get a Gaussian curve which looks much like your Origin plot.

 

Gaussian.png

 

The Plot 2 curve is from 128 points equally spaced along X and Y calculated from the Gaussian formula in the LV help using the output parameters from the fit.  Plot 1 is the Best Gaussian Fit output from the fit VI.  It only has five points.

 

Gaussina BD.png

 

I used default values for everything except X and Y.

 

Lynn

0 Kudos
Message 2 of 5
(7,226 Views)

Hi

 Thanks for your reply.

Basically you are interpolating the data to fit the curve. But there is a different problem Labview Fit always takes maximum Y value as center amplitude but Origin doesn't take it as center it is trying to fit any gaussian that will go through these points.

If you see the images I attached, the center of Labview fit is exactly at maximum Y value, however the center of origin is higher than maximum Y value.And origin's fit look more like a perfect Gaussian fit for the same set of data.

Labview user
0 Kudos
Message 3 of 5
(7,215 Views)
Solution
Accepted by Aojha

Interesting.

 

The default values of Initial Guess are all NaN, which causes LV to calculate the guesses.  The default values for Parameter Bounds are +/- Inf except for the offset which are both zero. This, of course, forces the offset output to be zero.  That seems a strange default, but they may have a good reason for it.

 

Changing the offset bounds to something else results in the output offset being ~215 and the center moves to ~1053.  These match the Origin result to 5 significant figures.

 

Lynn

 

Gauss Fit 2.png

Message 4 of 5
(7,207 Views)

Hi Johnsold,

Thank you again for your suggestion.

Now I am not sure why this is happening because I already have changed offset bound to -INF and INF when I posted this question. Actually I asked similar question in a post a few days back and I found this suggestion useful. By changing offset bounds I could get origin fit and Labview fit quite closer.

But now when I applied the same thing on my Windows xp PC and Labview 10.0 for fewer point I am getting different results. However your results seems pretty impressive.

Labview user
0 Kudos
Message 5 of 5
(7,193 Views)