Lineshapes

Peak functions and other frequency/position-domain models.

Peak Functions

CurveFitModels.gaussianFunction
gaussian(p, x)

Gaussian function with standard deviation parameterization.

Arguments

  • p: Parameters [A, x₀, σ] or [A, x₀, σ, y₀]
    • A: Amplitude
    • x₀: Center position
    • σ: Standard deviation
    • y₀: Vertical offset (default: 0.0)
  • x: Independent variable

Use fwhm_to_sigma and sigma_to_fwhm to convert between σ and FWHM.

\[\begin{aligned} f(x) = A \exp\left(-\frac{(x - x_0)^2}{2\sigma^2}\right) + y_0 \end{aligned}\]

https://en.wikipedia.org/wiki/Gaussian_function

source
CurveFitModels.lorentzianFunction
lorentzian(p, x)

Lorentzian (Cauchy) lineshape with FWHM parameterization.

Arguments

  • p: Parameters [A, x₀, Γ] or [A, x₀, Γ, y₀]
    • A: Peak amplitude (value at x₀)
    • x₀: Center position
    • Γ: Full width at half maximum (FWHM)
    • y₀: Vertical offset (default: 0.0)
  • x: Independent variable

The integrated area is A × π × Γ / 2.

\[\begin{aligned} f(x) = \frac{A}{1 + \left(\frac{x - x_0}{\Gamma/2}\right)^2} + y_0 \end{aligned}\]

https://en.wikipedia.org/wiki/Cauchy_distribution

source
CurveFitModels.pseudo_voigtFunction
pseudo_voigt(p, ω)

Pseudo-Voigt profile: a linear combination of area-normalized Gaussian and Lorentzian functions.

Note: Unlike gaussian and lorentzian which use peak-amplitude parameterization, pseudo_voigt uses area-normalized components. The parameter f₀ scales the total area, not the peak height.

Arguments

  • p: Parameters [f₀, ω₀, σ, α]
    • f₀: Area scaling factor
    • ω₀: Center position
    • σ: Width parameter (HWHM for Lorentzian component)
    • α: Mixing parameter (0 = pure Gaussian, 1 = pure Lorentzian)
  • ω: Independent variable (frequency)

\[\begin{aligned} f(\omega) = (1-\alpha) G(\omega) + \alpha L(\omega) \end{aligned}\]

where G and L are normalized Gaussian and Lorentzian functions.

https://en.wikipedia.org/wiki/Voigt_profile

source

Other Lineshapes

CurveFitModels.logisticFunction
logistic(p, x)

Logistic (sigmoid) function for curve fitting.

Arguments

  • p: Parameters [L, k, x₀] or [L, k, x₀, y₀]
    • L: Maximum value (supremum of the curve)
    • k: Steepness of the curve
    • x₀: Midpoint (x-value of the sigmoid's center)
    • y₀: Vertical offset (default: 0.0)
  • x: Independent variable

\[\begin{aligned} f(x) = \frac{L}{1 + e^{-k(x - x_0)}} + y_0 \end{aligned}\]

https://en.wikipedia.org/wiki/Logistic_function

source
CurveFitModels.gaussian2dFunction
gaussian2d(p, coords)

Two-dimensional Gaussian function for curve fitting.

Arguments

  • p: Parameters [A, x₀, σx, y₀, σy] or [A, x₀, σx, y₀, σy, z₀]
    • A: Amplitude
    • x₀: Center x-position
    • σ_x: Standard deviation in x
    • y₀: Center y-position
    • σ_y: Standard deviation in y
    • z₀: Vertical offset (default: 0.0)
  • coords: Tuple of (X, Y) coordinate matrices (from meshgrid) or matrix where each row is [x, y]

Returns a vector (flattened) for compatibility with CurveFit.jl.

\[\begin{aligned} f(x, y) = A \exp\left(-\frac{(x - x_0)^2}{2\sigma_x^2} - \frac{(y - y_0)^2}{2\sigma_y^2}\right) + z_0 \end{aligned}\]

https://en.wikipedia.org/wiki/Gaussianfunction#Two-dimensionalGaussian_function

source

Oscillator Models

Complex susceptibility functions for modeling dielectric response.

CurveFitModels.lorentz_oscillatorFunction
lorentz_oscillator(p, ν)

Complex Lorentzian susceptibility function (Lorentz oscillator model).

Arguments

  • p: Parameters [A, ν₀, Γ]
    • A: Oscillator strength
    • ν₀: Resonance frequency
    • Γ: Linewidth (damping)
  • ν: Frequency (independent variable)

\[\begin{aligned} \chi(\nu) = \frac{A}{\nu_0^2 - \nu^2 - i\Gamma\nu} \end{aligned}\]

The real and imaginary parts are dielectric_real and dielectric_imag, respectively.

https://en.wikipedia.org/wiki/Lorentzoscillatormodel

source
CurveFitModels.dielectric_realFunction
dielectric_real(p, ν)

Real part of complex Lorentzian susceptibility (Lorentz oscillator model).

This is equivalent to real(lorentz_oscillator(p, ν)).

Arguments

  • p: Parameters [A, ν₀, Γ]
    • A: Oscillator strength
    • ν₀: Resonance frequency
    • Γ: Linewidth (damping)
  • ν: Frequency (independent variable)

\[\begin{aligned} \chi_1(\nu) = \text{Re}\left[\frac{A}{\nu_0^2 - \nu^2 - i\Gamma\nu}\right] = \frac{A (\nu_0^2 - \nu^2)}{(\nu_0^2 - \nu^2)^2 + (\Gamma\nu)^2} \end{aligned}\]

https://en.wikipedia.org/wiki/Lorentzoscillatormodel

source
CurveFitModels.dielectric_imagFunction
dielectric_imag(p, ν)

Imaginary part of complex Lorentzian susceptibility (Lorentz oscillator model).

This is equivalent to imag(lorentz_oscillator(p, ν)).

Arguments

  • p: Parameters [A, ν₀, Γ]
    • A: Oscillator strength
    • ν₀: Resonance frequency
    • Γ: Linewidth (damping)
  • ν: Frequency (independent variable)

\[\begin{aligned} \chi_2(\nu) = \text{Im}\left[\frac{A}{\nu_0^2 - \nu^2 - i\Gamma\nu}\right] = \frac{A \Gamma \nu}{(\nu_0^2 - \nu^2)^2 + (\Gamma\nu)^2} \end{aligned}\]

https://en.wikipedia.org/wiki/Lorentzoscillatormodel

source

Helper Functions

CurveFitModels.fwhm_to_sigmaFunction
fwhm_to_sigma(fwhm)

Convert full width at half maximum to Gaussian standard deviation.

σ = FWHM / 2√(2ln2) ≈ FWHM / 2.355

source
CurveFitModels.gaussian_areaFunction
gaussian_area(A, σ)

Calculate the integrated area under a Gaussian with peak amplitude A and standard deviation σ.

Area = A × σ × √(2π)

source