I modified the function delta to take 2 lists of numbers, rather than just 2 numbers, and now the function works as expected, as does the optimization.
Regarding fitting spectra in general, I was actually thinking of fitting the actual line shape of the observed spectrum. This is particularly important when lines are close together and the apparent chemical shift of a peak is shifted. All one needs are the signal intensities for a transformed and phase corrected FID.
Attachments: