You are now following this Submission
- You will see updates in your followed content feed
- You may receive emails, depending on your communication preferences
The Voigt function is given by the convolution of Lorentz function and Gauss function. I've never used this specific function until I had collaboration with scientists using Raman spectroscopy. In Raman spectroscopy, it is needed to deconvolve Raman peaks to the Lorentz and Gaussian functions using non-linear least squares fitting. Here, the low-level Levenberg–Marquardt algorithm is posted to do such a fitting. The anonymous function in Matlab is used to define Voigt function. The general form of Levenberg–Marquardt algorithm presented here is taken from on-line available material "METHODS FOR NON-LINEAR LEAST SQUARES PROBLEMS" written by K. Madsen, H.B. Nielsen, O. Tingleff from Technical University of Denmark. The fitting parameters in my algorithm are offset, area, width of Lorentz peak, width of Gaussian peak and center position. Please enjoy the algorithm.
It is possible to transfer presented principles from Matlab to C++ using Eigen linear algebra library if needed. In practice, sometimes we develop specific algorithms in Matlab because Matlab provides us convenient environment for mathematical modelling. Later Matlab code can be rewritten to the C++ for faster and more advanced applications.
Cite As
Karol Vegso (2026). Levenberg–Marquardt algorithm - Voigt function with area (https://www.mathworks.com/matlabcentral/fileexchange/106205-levenberg-marquardt-algorithm-voigt-function-with-area), MATLAB Central File Exchange. Retrieved .
General Information
- Version 1.0.1 (2.8 KB)
MATLAB Release Compatibility
- Compatible with R2018a to R2021b
Platform Compatibility
- Windows
- macOS
- Linux
