This function will accept x and y data (originally designed for EPR
2nd derivative data, keep this in mind when interpreting the A-output),
for which it will try to subtract a baseline (i.e.
the bias will become approximately 0), except on the user-specified interval.
It will return the integrated data in Y and the mean value of Y after the
right border of the interval.
The baseline will be 'guessed' with clamped spline interpolation (the
spline will look like a line at the endpoints, or in other words: the 2nd
derivative will be 0). The precision of this interpolation (how closely
the interpolant should follow the original data) is controlled by
interpolation_points: higher is more precise. The optimal value for
interpolation_points can be guesstimated by adding the 'interp' specifier
at the end of the argument list. This will display the interpolation line
and allow the user to see how well this interpolation estimates the bias.
The interval for which the function may not be spline-interpolated
(because it is assumed to contain relevant data which is not noise/bias)
will be specified by a figure-prompt that requires two mouseclicks to
specify the (x-axis) interval.
In that interval it will just linearly interpolate the start- and
endpoints, as to avoid disturbing the data too much.
The next step is to subtract this interpolation from the y-values to
remove the bias. The last step is integrating this data with the
cumtrapz() function (to avoid amplifying noise too much, the user can of course
experiment with different numerical integration methods and replace this
on line 68).
Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.