Peakpvoigt1: Difference between revisions
Jump to navigation
Jump to search
imported>Jeremy (Importing text file) |
imported>Scott |
||
(13 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
===Purpose=== | ===Purpose=== | ||
Outputs a pseudo-Voigt function, Jacobian, and Hessian for a given set of input parameters and axis. | Outputs a pseudo-Voigt function, Jacobian, and Hessian for a given set of input parameters and axis. | ||
===Synopsis=== | ===Synopsis=== | ||
: [y,y1,y2] = peakpvoigt1(x,ax) | : [y,y1,y2] = peakpvoigt1(x,ax) | ||
===Description=== | ===Description=== | ||
Given a 4-element vector of parameters (x) and a | |||
Given a 4-element vector of parameters (x) and a vector of independent variables e.g. a wavelength or frequency axis (ax). PEAKPVOIGT1 outputs a pseudo-voigt peak (y). If more than one output is requested, it also outputs the Jacobian (y1) and Hessian (y2). Derivatives are with respect to the parameters and are evaluated at (x). This function is called by PEAKFUNCTION. | |||
* x = 4 element vector with parameters | |||
* x(1) | ====Inputs==== | ||
* x(2) | |||
* x(3) | * '''x''' = 4 element vector with parameters | ||
* x(4) | * '''x(1)''': coefficient, | ||
* ax = | * '''x(2)''': mean, | ||
* '''x(3)''': spread, and | |||
* y = | * '''x(4)''': fraction Gaussian. | ||
* y1 = | * '''ax''' = 1 by N vector of independent variables e.g,. a wavelength or frequency axis. | ||
* y2 = | |||
====Outputs==== | |||
* '''y''' = 1 by N vector with the pseudo-voigt function evaluated at (x) and given by | |||
z = p-x(2) | |||
y = x(1)*( x(4)*exp(-4*ln(2)*z.^2/x(3)^2) + (1-x(4))*x(3)^2./(x(3)^2+z.^2) ); | |||
* '''y1''' = dy/dxi, 4 by N matrix of the Jacobian of evaluated at (x). | |||
* '''y2''' = d2y/dxi^2, 4 by 4 by N matrix of the Hessian of evaluated at (x). | |||
===Algorithm=== | ===Algorithm=== | ||
===Example=== | |||
=== | |||
Make a single known peak | |||
ax = 0:0.1:100; | |||
y = peakpvoigt1([2 51 8 0.5],ax); | |||
figure, plot(ax,y) | |||
===See Also=== | ===See Also=== | ||
[[peakfunction]], [[peakgaussian]], [[peaklorentzian]], [[peakpvoigt2]], [[peakstruct]] | [[peakfunction]], [[peakgaussian]], [[peaklorentzian]], [[peakpvoigt2]], [[peakstruct]] |
Latest revision as of 16:20, 24 October 2013
Purpose
Outputs a pseudo-Voigt function, Jacobian, and Hessian for a given set of input parameters and axis.
Synopsis
- [y,y1,y2] = peakpvoigt1(x,ax)
Description
Given a 4-element vector of parameters (x) and a vector of independent variables e.g. a wavelength or frequency axis (ax). PEAKPVOIGT1 outputs a pseudo-voigt peak (y). If more than one output is requested, it also outputs the Jacobian (y1) and Hessian (y2). Derivatives are with respect to the parameters and are evaluated at (x). This function is called by PEAKFUNCTION.
Inputs
- x = 4 element vector with parameters
- x(1): coefficient,
- x(2): mean,
- x(3): spread, and
- x(4): fraction Gaussian.
- ax = 1 by N vector of independent variables e.g,. a wavelength or frequency axis.
Outputs
- y = 1 by N vector with the pseudo-voigt function evaluated at (x) and given by
z = p-x(2) y = x(1)*( x(4)*exp(-4*ln(2)*z.^2/x(3)^2) + (1-x(4))*x(3)^2./(x(3)^2+z.^2) );
- y1 = dy/dxi, 4 by N matrix of the Jacobian of evaluated at (x).
- y2 = d2y/dxi^2, 4 by 4 by N matrix of the Hessian of evaluated at (x).
Algorithm
Example
Make a single known peak
ax = 0:0.1:100; y = peakpvoigt1([2 51 8 0.5],ax); figure, plot(ax,y)
See Also
peakfunction, peakgaussian, peaklorentzian, peakpvoigt2, peakstruct