## Baseline Spline Fit

Average rating

For fitting and subtracting spline type baselines to spectroscopic data. A spline is a continuous curve that passes through points ("nodes") selected by the user. This Igor procedure file provides an interface that allows the user to position the points and see the resulting baseline. Version 4 uses a control panel interface.

### How to use Baseline Spline Fit

A 1d wave must be plotted in a graph window before selecting 'Spline Baseline' from the Macros menu. The wave must be plotted on the default bottom and left axes. A control panel will be added to the left of the graph window. When 'edit mode' is selected you can drag the nodes. The spline should update as the nodes are repositioned. When in edit mode you can add a new node at any position on the graph by positioning the mouse cursor and clicking while holding down the control key. Nodes may be deleted by clicking them with the option key held down. Clicking anywhere in the graph window with the shift key held down will toggle between node editing mode and 'normal' mode where you can interact with the graph as usual.

#### Panel controls

• Data wave: select a trace for baseline correction. When switching between traces the nodes will retain their X-positions but will be placed on the selected data wave at those positions (unless they lie outside of the range of the data wave).
• Akima: fit an Akima style spline through the nodes. Akima splines can have sharper bends than cubic splines.
• PCHIP: ffit a cubic Hermite spline through the nodes. This spline type doesn't overshoot local maxima or minima in node sequence. First derivative is continuous through the nodes, but second derivative may be discontinuous.
• Cubic: fit a cubic spline through the nodes.
• Ends: At the ends of the spline where the cubic function is not fully constrained select a method to add a constraint. 1st deriv.: match 1st derivative; natural: match 2nd derivative. Affects only cubic spline type.
• Linear: connect the nodes with linear segments.
• Smoothing: fit a smoothing spline, which does not have to pass exactly through the nodes. The degree of smoothing is adjustable.
• Edit mode: toggle between node editing and normal modes.
• Reset: set node positions by spacing a set number of nodes at regular intervals along the section of the data wave displayed in the graph window. No nodes will be set beyond the range of the graph axes.