From: Andrew Dallow on 23 Jul 2010 08:59 Hi, I was wondering if someone can help me with this problem. I want to use matlab to do a least squares fit to a double peak Gaussian function of the form: y=a*exp(-((x-b)^2)/(2*c^2)) + d*exp(-((x-e)^2)/(2*c^2)) where the letters are just constants, x and y are variables. normally for a single Gaussian I can put y=a*exp(-((x-b)^2)/(2*c^2)) into log form as: ln y=ln a - ((x-b)^2)/(2*c^2) then substitution ln y = A1 +A2*x + A3*X^2 and do a least squares fit to this and the data, where A1 = ln a - b^2/(2*c^2) A2 = b/c^2 A3 = 1/(2*c^2) then solve to get the constants. But when i repeat this for the double Gaussian equation I get entangled constants where you cannot find one without knowing the other. i.e A1 = ln a*d - (1/(2*c^2))*(b^2 +e^2) A2 = (b+e)/c^2 A3 = 1/c^2 Would anyone know how I could go about calculating these constants (a, b, c,d,e) or at least determine e and b the x position of the peak centres?
|
Pages: 1 Prev: Change a class Property Next: how can I match all lines except empty ones? |