Arc Hull Baseline
Tue, 11/01/2016 - 04:53 pm
This package adds a collection of algorithmically-defined baselines for spectral data. It's named for the arc hull type baseline, in which a circular arc with adjustable depth is added to the spectrum (ie., the spectrum is bent), and the lower portion of a convex hull is calculated for the resultant spectrum. The baseline consists of the sum of the arc and the convex hull.
How to use the Arc Hull package
Arc Hull requires that a spectrum is plotted in the top graph. Selecting Arc Hull from the Macros menu will add a panel on the left side of the graph. You can choose from a popup menu which of the spectra in the graph to use for the calculation. A working copy of the baseline and baseline-subracted spectrum are appended to the plot; these are updated as you adjust the parameters.
Arc Hull controls
Arc Hull: Adjust arc depth to find an optimal value. The arc depth SetVar increments by 10% of its value. Setting arc depth to zero creates a convex hull (a.k.a. 'rubber band') type baseline.
Spline: baseline is a cubic spline using the convex hull as nodes. When arc depth is non-zero the nodes are more like a subset of alphashape vertices.
Iterative: the function selected in the Fit Func popup is fitted iteratively. Any fit point with a negative residual (positive if the negative peaks checkbox is selected) is replaced by the corresponding point from the input data after each iteration, thus eliminating points with a positive residual, so ultimately eliminating peaks from the fit. The fit output is used as the input for the next iteration.
Smooth: the baseline is calculated for a smoothed copy of the spectrum, then subtracted from the original. With the right choice of smoothing factor, the baseline will pass through spectral noise rather than underlying the noise. Note that the baseline-subtracted output is not smoothed with respect to the original data, the smoothing is applied only to a temporary copy that's discarded after calculating the baseline.
Base level: the output (baseline-subtracted) spectrum is offset from zero by this amount. Useful for negative peaks that extend down from a non-zero value. For convex baselines, use negative arc depth (you'll have to type a negative value in the setvar).
Negative Peaks checkbox: subtract the top part of the convex hull. Useful for dealing with downward facing peaks, or for when you have a reverse-scaled vertical axis.
Use graph limits checkbox: calculate baseline within the horizontal axis limits of the graph. Unless the entire wave can be seen in the graph, the baseline-subtracted output wave will have a smaller range than the data wave.
Subtract: creates a copy of the baseline and a baseline-subtracted output spectrum in the current data folder and appends them to the plot.
All in one: creates a baseline-subtracted output spectrum for each wave on the graph (other than waves with _base and _sub suffixes) using the current settings for arc depth, smoothing, base level and checkbox values.
Closing the Arc Hull panel will remove temporary package-created waves from the graph and clean up after the package, as will initializing on another graph window.
For X-Y data, the X wave needs to be monatonic for Arc Hull calculation.
See my Baseline Spline and Baseline Fitting projects for more baseline options.
Current Project Release
Arc Hull Baseline IGOR.6.30.x-2.11
|Version Date:||Thu, 01/09/2020 - 04:31 am|
|Version Patch Level:||11|
|OS Compatibility:||Windows Mac-Intel|
Now works with traces plotted on any axes. Adds new option to recolor traces during fitting, to help identify the active trace for fitting when many traces are plotted in the same graph.
Igor Pro 8
Igor XOP Toolkit
Igor NIDAQ Tools MX