Fitting Flat-Top Guassian Data

13 ビュー (過去 30 日間)
Ronni
Ronni 2011 年 6 月 23 日
回答済み: Aaron Fetterman 2021 年 2 月 23 日
I have a 2D data set that looks like a Gaussian distribution. However, in my case I have a flat top Gaussian, rather than the one that starts falling off from the center. Basically 1cm of the distribution at the center looks like a perfect circle and then the intensity falls off. It seems like I may have to use some sort of circ fuction and then exponential/gaussian to take into account the fall off. I'm not too sure how I can do this in matlab. Any help will be highly appreciated. Thanks!
  1 件のコメント
Ronni
Ronni 2011 年 6 月 23 日
I could use multiple Gaussian functions and add them but this isn't quite what I'm looking for. I want to be able to extract FWHM from the fit. Not sure how I would do that if I use multiple Gaussians.

サインインしてコメントする。

回答 (4 件)

the cyclist
the cyclist 2011 年 6 月 23 日
If you know the functional form that you want to use to fit your curve, you could use the nlinfit() function.

Ronni
Ronni 2011 年 6 月 26 日
So I found out that a sum of multiple erf fuctions will work for this. How many that I don't know unless I try to fit them. Will nlinfit determine N (number of erf fuction) or would I have to use trial and error method?
  1 件のコメント
Andrew Newell
Andrew Newell 2011 年 6 月 26 日
I doubt that you can do a fit unless you know in advance how many parameters you need.

サインインしてコメントする。


Andrew Newell
Andrew Newell 2011 年 6 月 26 日
The Johnson and Pearson distributions are generalizations of the normal distribution, and MATLAB has fitting functions for them (assuming you have the Optimization Toolbox).
If you just want to extract FWHM, you could download fwhm from the File Exchange. I haven't used it, but it gets good reviews.

Aaron Fetterman
Aaron Fetterman 2021 年 2 月 23 日
One solution would be to use a supper gaussian function. It follows the same format as a regular gaussian with an extra parameter to make the flat top more pronounced.
Hope this helps... a little late in the game.
There are a lot of other potential functions available too as found at this link.
Came accros this in own research and thought I would add to one of these boards.

Community Treasure Hunt

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

Start Hunting!

Translated by