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.

enter image description here

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

  • 1
    $\begingroup$ So your question is..? How to make the same plot in Mathematica? First we would need the data, or a sample of it. $\endgroup$
    – Öskå
    May 20, 2014 at 9:56
  • 2
    $\begingroup$ 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 $\endgroup$ May 20, 2014 at 9:56
  • $\begingroup$ 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? $\endgroup$
    – A postdoc
    May 20, 2014 at 11:10
  • $\begingroup$ 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. $\endgroup$ May 20, 2014 at 11:19
  • $\begingroup$ 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. $\endgroup$ May 20, 2014 at 14:08

1 Answer 1


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:

plot of the Voigt kernel

A (rather nominal) stick spectrum:

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

plot of the stick spectrum to be convolved with the kernel


ListConvolve[kernel, spectrum, middle]


plot of the Voigt-broadened stick spectrum after convolution

And that's it.

  • $\begingroup$ I wonder if ListConvolve would be of any help if peaks are not on regular (equidistant) mesh? $\endgroup$
    – yarchik
    2 days ago

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.