03-19-2013 11:00 PM
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
Solved! Go to Solution.
03-20-2013 02:36 PM
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.
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.
I used default values for everything except X and Y.
Lynn
03-21-2013 07:32 AM
Hi johnsold
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.
03-21-2013 10:07 AM
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
03-21-2013 10:59 PM
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.