How can I create a Gaussian curve with given data?

  • Thread starter Thread starter csand
  • Start date Start date
  • Tags Tags
    Curve Gaussian
csand
Messages
4
Reaction score
0
Hi,
My understanding in this is limited, but I'm trying to create a set of Gaussian curve response functions that will be convoluted with some signal data. I've dug all around the internet/textbooks but I'm having trouble finding a way to create the curve with the data I have. All I know is the height is bound from 0 to 1 (or at least very very close to 0 for my purposes). I have the center value (x-axis) for every curve I need to generate, and I know the FWHM of every curve. So to generate a curve I will know:

-FWHM for the curve
-The center xaxis value (Denoted by Lambda_Center)
-The height

The only formula I have is unsourced and I'm not sure it's working properly for all cases:

e^( -1*(Lambda - Lambda_Center)^2 / (FWHM/2*sqrt(ln2))^2 )

I have Lambda_Center, and Lambda, if this were to be looped in a program, would increment/decrement by some value X for each point on the gaussian (ex: 0.1,0.2,0.3,0.4,L_C,0.4,0.3,0.2,0.1)

Does anyone recognize this formula/method for creating a gaussian? Can anybody see any big holes in the method? Everything I see online usually involves using sigma/mean.

Thanks,
-Chris

***EDIT***: fixed formula bracketing
 
Last edited:
Physics news on Phys.org
csand said:
e^[ -1*(Lambda - Lambda_Center)^2 / (FWHM]/2*sqrt(ln2))^2) ]
Looks right, except that you have some issues with parens and brackets. But look, there's an easy way to test it. You want the value to be 1 at Lambda_Center and 0.5 at Lambda_Center +- FWHM. So plug in those numbers and see if it works.
 
I have created some curve data with this formula, and for the most part the data seems reasonable. However, I find that sometimes I need hundreds of points just to see the function approach 0, and, unless I choose a very high resolution step (such as 0.01), I don't often find a 0.5, but values close to, such as 0.52xxxx,0.489xxxx, etc. I'm glad to know that the formula, other than the bracketing errors, appears legitimate.

Thanks,
-C
 
I'm not sure how closely you need it to get down to zero. It will get to 0.05 at 2.08 FWHM, to 0.01 at 2.58 FWHM, and 0.001 at 3.16 FWHM. Obviously, if your points are spaced such that FWHM is 100 of them, it's going to take hundreds of points to get down near zero. (I assume they're equally spaced.) Nothing to do about that.

You should not expect to get exactly 0.5 at any of your points unless the spacing of the points exactly divides FWHM and Lambda_Center exactly corresponds to one of the points.

I was not actually suggesting that you look at the points generates by your program. I was suggesting that YOU actually plug the numbers into the formula YOURSELF and check that it gives the right result.

EDIT: Oops! I just realized that, while I've been writing FWHM, I was actually thinking HWHM. So everything I've said so far is off by a factor of two. If you replace FWHM with FWHM/2 in the above, then it should be right.
 
Last edited:
Namaste & G'day Postulate: A strongly-knit team wins on average over a less knit one Fundamentals: - Two teams face off with 4 players each - A polo team consists of players that each have assigned to them a measure of their ability (called a "Handicap" - 10 is highest, -2 lowest) I attempted to measure close-knitness of a team in terms of standard deviation (SD) of handicaps of the players. Failure: It turns out that, more often than, a team with a higher SD wins. In my language, that...
Hi all, I've been a roulette player for more than 10 years (although I took time off here and there) and it's only now that I'm trying to understand the physics of the game. Basically my strategy in roulette is to divide the wheel roughly into two halves (let's call them A and B). My theory is that in roulette there will invariably be variance. In other words, if A comes up 5 times in a row, B will be due to come up soon. However I have been proven wrong many times, and I have seen some...
Back
Top