# Discrete peaks to curve via Voigt summation

I have two data sets.

One is an experimental recording of an absorption spectrum, composed of regularly spaced (wavenumber, intensity) coordinates with a fine wavenumber resolution, thus making superposed Voigt peaks.

The second one is computation that gives coordinates (wavenumber, intensity) for the maximum of each peak.

I want to obtain a function that would

• Take X,Y coordinates of my simulated dataset
• Generate a Voigt profile (mean X from dataset, integration Y from dataset, fixed Sigma, fixed Gamma)
• Repeat for the whole experimental dataset (~150 points displayed as green bars)
• Plot the sum of all these Voigt functions

The Voigt profile is not a requirement, I can work with a Gaussian to begin with. So there would only be 3 parameters, 2 from the dataset and Sigma.

This graph was made in Origin, but I'm using Mathematica 9.

• So your question is..? How to make the same plot in Mathematica? First we would need the data, or a sample of it. – Öskå May 20 '14 at 9:56
• All I see is a description of what you're trying to do. What, exactly, is the question? By the way: pgopher.chm.bris.ac.uk – Oleksandr R. May 20 '14 at 9:56
• My question is: is there a combination of functions that would take a coordinate and make a Voigt profile out of it, and then sum all these profiles? – A postdoc May 20 '14 at 11:10
• Then the answer's "yes", but this is not an efficient way to do it. You can find the convolution of your stick spectrum with a Voigt profile directly using ListConvolve. For analysis purposes I would still personally choose a dedicated program (such as the one I linked to, which is one of the best) rather than doing it in Mathematica. – Oleksandr R. May 20 '14 at 11:19
• In light of @OleksandrR.'s comments, can you state why you want to make the graph in Mathematica? It seems like you've got what you want in Origin. – bobthechemist May 20 '14 at 14:08

## 1 Answer

I think OP could have done this by themselves, or at least indicated whether or not they had tried it or anything else. We are not just here to do the leg-work for your Ph.D. while you feign helplessness. Anyway, a straightforward use of ListConvolve as I suggested in the comments:

abscissae = Range[-10, 10, 0.05];
middle = Ceiling[Length[abscissae]/2];

kernel = (PDF@VoigtDistribution[0.1, 0.2])[abscissae] // Chop;


VoigtDistribution is new in 9, but if you have an older version, you can make your own. It looks like this:

A (rather nominal) stick spectrum:

spectrum = ReplacePart[
ConstantArray[0, Length[abscissae]],
{99 -> 1, 101 -> 1, 192 -> 1, 208 -> 2, 291 -> 1, 309 -> 1}
];


Now,

ListConvolve[kernel, spectrum, middle]


gives:

And that's it.