12-16-2016 08:40 AM - edited 12-16-2016 08:41 AM
Hi
I've got a problem where I have to fit quadratic function (which is good enough approximation of gaussian) to the plot that looks like part of gaussian with additional left and right data (it's a scan of a weld between two steal objects)
My job is to find angles between this "middle" shape and left or right part (effectively find the green points). This middle shape is a weld that can be easy to spot by human, but it's kind of a nightmare to find generic function that could detect it. This shape can be bigger or smaller, shuttered on top, or be concave, but it always have some kind of gaussian shape, because when weld is cooling down (sometimes upside down), it's forming like that.
The question is, what could be the best and most generic approach to do it? I was trying second derivative on moving average, some stock market indicators, etc. I was trying to train neural network to find those points, but it's useless. I need some kind of fitting function that has a fitting score, that fits only to data that's having good fit, and discarding all other.
Any ideas?
Please help
12-16-2016 09:01 AM
Hmmm...
1) cut average of the right and left region from array,
2) fit by 3-d order polynomial
3) distinguish between 1 and 2
4) find largest amplitude of oscillation in case of 2
5) fit by gaussian
12-16-2016 09:07 AM - edited 12-16-2016 09:10 AM
Option 2:
Use general fit algorithm based on vi (nonlinear curve fit.vi) with 2 parameters of the model vi: cut from the left and right side. Fit remaining array by gaussian inside. Estimate width and amplitude first and increase output error if fit results are too far away (to distinguish between first and second oscillation on 2)
12-16-2016 09:31 AM
Hi
What do you mean by cut average from left and right side?
Do you mean moving average? And measuring if distance between data and average is bigger than some value?
Sometimes left and right edge are very noisy and have a lot of strange shapes like here:
The right and left side is very often not flat.