Curve fitting for a line profile

3 visualizzazioni (ultimi 30 giorni)
Thomas
Thomas il 17 Ott 2013
Modificato: Matt J il 18 Ott 2013
I would like to use an automated process to describe my line profile curve (such as that in the image) as the sum of an arbitrary number of Gaussian (or other) statistical distributions. Ideally:
  1. The process should be able to guess how many Gaussian distributions would be necessary (the algorithm my brain uses can compute this extremely quickly when I look at the curve, for example!). Typically, I would need between 5 to 40 of them. In this image example, there are 14.
  2. It would be capable of extracting the baseline (which, in this case, is not exactly linear). I might be able to do this by using a function to find valleys and fit a function to these positions.
  3. It should do this all automatically with no (minimal) user input, since I'll need to apply this to hundreds of similar profiles.
The reason I'm choosing a curve fitting approach as opposed to a simple FFT is because I need to be able to describe each individual peak in my dataset in terms of both its peak position and its FWHM value (and perhaps even amplitude could be of use, especially if I can subtract the baseline). I will be looking for trends in the variation of these two values as a function of distance (x-axis). Thus an FFT wouldn't - to my knowledge, at least - suffice.

Risposte (1)

Matt J
Matt J il 18 Ott 2013
Modificato: Matt J il 18 Ott 2013
I tend to wonder wheter a spline fit using spaps or spaps2 would be the way to go. You could then use fndir and fnzeros to get the locations of all the max and mins. You could fit the mins using spmak to get your "baseline".
If nothing else, this would at least give you an estimate of the number and locations of the peaks, which you could then feed to lsqcurvefit to build whatever model you wish. I think a sum of Gaussians would be a difficult fit, though. You couldn't assume that 14 Gaussians would be a good fit just because you see 14 peaks, for example.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by