09-24-2020 09:29 AM
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.
09-24-2020 04:22 PM
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.
09-25-2020 11:31 AM - edited 09-25-2020 11:32 AM
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.