iNMR icon

Curve Fitting Commands

The curve-fitting module (a.k.a. deconvolution module) appears when the you select a region of the spectrum and choose Simulate > Deconvolution. The basic job of the module is to fit the experiment with a model of the spectrum. This model contains 4 parameters per peak. You must decide which parameters to keep constant and which will be optimized by the computer. In the second case, put a check mark after the corresponding numerical value.

The table below contains the meaning of each command. The codes between quotes can be used to call the commands from a script, as explained at the bottom of this page.

command / “code”

action

split
“cut   ”

Splits the selected peak in two halves; this is the only way to add a new peak into the model.

remove
“clear”

Removes the selected peak.

help
“HELP”

Shows this page.

undo
“undo”

Restores the old parameters after a manual or an automatic fitting.

fit
“ok   ”

Runs the automatic fitting (it's a Levenberg-Marquardt algorithm).

toggle
“TOGGLE”

Toggles between the two display modes (individual components or total + difference).

smooth
“SMOOTH”

Clicked once, restarts the module. The more you click, the more the details of the spectrum (including noise) are ignored (the model will contain less peaks).

copy
“copy”

Exports the list of peaks in textual form. This is how you can save the results,
or move them into the J manager.

paste
“paste”

Imports a list of peaks from another deconvolution window or restores a previously saved state.

--
“Rerr”

Copies the residual error into the clipboard. Only available when scripting.

export
“svas”

Creates an iNMR document containing the green (red) plot(s); if there are two or more components and the display mode is “individual components”, then a pseudo-2D spectrum is created (click the toggle icon to toggle between the two display modes). You can use the result for printing, spectral editing, etc...

check
“SEL1”

It's a shortcut to check the four boxes on the selected line.

check all
“sall”

Selects all the parameters for optimization.

uncheck
“NONE”

Unselects all the parameters for optimization.

same %
“SAME”

All peaks have the same shape and the % of Lorentzian character can be adjusted only manually.

close
“close”

Closes the deconvolution module without saving.


 

Scripting the Deconvolution

All the operations described above can also be performed with a script and all with the single command dec(). It has 3 syntactic forms. The simplest form is used to create the module and is equivalent to the menu command Simulate > Deconvolution. You invoke the function without parameters and receive a reference to the newly created module. It's necessary to pass the same reference to all the other calls to dec():

module = dec()

A single peak and the corresponding row into the table are always selected. To select another peak, call dec() with the reference to the module and an integer (from 1 to the number of rows):

dec( module, index )

To check and uncheck the parameters of the selected row, pass a string containing the plus sign where you want a check sign and zero (or dash or space or dot) where you don't want it. For example:

dec( module, "-++-" )

The other operations correspond to the icons and buttons of the module. You will pass the reference and a string taken from the table above. Each string must contain at least 4 characters (spaces matter), but the characters after the 4th are ignored. Don't change the case. For example, to perform the deconvolution:

dec( module, "ok   " )

If you only pass the reference to the module, without further parameters, the function returns, in the order, the number of peaks, the selected peak, the maximum number of peaks that can be fitted with the data points selected and the current state of the “smooth” button:

number_of_peaks, selected_row, max_no_of_peaks, smoothing = dec( module )

Related Topics

About Curve Fitting

Measuring the Area by Fitting to a Model

 

Web Tutorial

The Ultimate Deconvolution Experience