LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Fitting a set of data to a gaussian peak with a linear equation as offset.

I am trying to fit a set of data to a linear offset gaussian peak. This means that the offset is calculated on a point-by point basis from a separately determined linear fitting that is done earlier in the program. How can I achieve this as I can only put a constant in the parameter bounds of the gaussian peak, and if I try to feed it an array of calculated values using my x-values and the linear equation it is the wrong data type. The model is essentially a gaussian peak fit +mx+b.

0 Kudos
Message 1 of 3
(1,069 Views)

If you have already fit the linear offset, then you can evaluate the linear offset (mx+b) at all x-values in your data and subtract from your y-values before passing to the Gaussian Fit.

Message 2 of 3
(1,029 Views)

As has been said, if the underlying slope&offset is known exactly from the beginning, subtract it from the data and fit the remaining data to a Gaussian without offset.

 

Of course LabVIEW has a full featured nonlinear fit where you can define any model with any number of parameters, so just create a model with five parameters (amplitude, position, width, slope, intercept) which will allow you to fit the raw data without needing to even know the background. You could even expand it to multiple gaussian peaks, polynomial background, or other shapes.

0 Kudos
Message 3 of 3
(990 Views)