Baseline Spline Fit

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.
  • 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.
  • Load: reload the node positions from a previous fit.
  • Subtract: creates a copy of the baseline and a baseline-subtracted output spectrum in the current data folder and appends them to the plot; saves the node positions in a 2d wave in the current data folder.
If you find this package useful, check out my Arc Hull and Baselines projects. The Arc Hull package creates 'algorithmically defined' baselines, and the Baselines package provides an interface for fitting various functions to masked regions of the spectrum. The three packages are converging toward a common format of control-panel based interface, and may eventually be combined into a single package.

Project Details

Current Project Release

Baseline Spline Fit IGOR.6.30.x-4.10

Release File: BaselineSpline_7.ipf
Version: IGOR.6.30.x-4.10
Version Date: Sun, 02/11/2018 - 03:16 am
Version Major: 4
Version Patch Level: 10
OS Compatibility: Mac-Intel Windows Mac-PPC
Release Notes: Adds piecewise cubic Hermite interpolating polynomial (PCHIP) spline type
View All Releases




Igor Pro 8

Learn More

Igor XOP Toolkit

Learn More

Igor NIDAQ Tools MX

Learn More