PLS_Toolbox Documentation: baselinew< baseline browse >

baselinew

Purpose

Baseline using windowed polynomial filter.

Synopsis

 

[y_b,b_b]= baselinew(y,x,width,order,res,options)

Description

BASELINEW recursivley calls LSQ2TOP to fit polynomials to the bottom (or top) of a curve e.g. a spectrum. It uses a windowed approach and can be considered a filter or baseline (low frequency) removal algorithm. The window depends on the frequency of the low frequency component (baseline) and wide windows and low order polynomials are often used. See LSQ2TOP.

The curve(s) to be fit (dependent variable) y, the axis to fit against (the independent variable) x [e.g. y = P(x)], the window width width (an odd integer), the polynomial order order, and an approximate noise level in the curve res. Note that y can be MxN where x is 1xN. The optional input options is discussed below.

Output y_b is a MxN matrix of ROW vectors that have had the baselines removed, and output b_b is a matrix of baselines. Therefore, y_b is the high frequency component and b_b is the low frequency component.

Examples

If y is a 5 by 100 matrix then

y_b = baselinew(y,[],25,3,0.01);

gives a 5 by 100 matrix y_b of row vectors that have had the baseline removed using a 25-point cubic polynomial fit of each row of y.

If y is a 2 by 100 matrix then

y_b = baselinew(y,x,51,3,0.01);

gives a 2 by 100 matrix y_b of row vectors that have had the baseline removed using a 51-point second order polynomial fit of each row of y to x.


Options

        options   = structure array with the following fields:

       display :   [ 'off' | {'on'} ] governs level of display to command window.

             trbflag :   [ 'top' | {'bottom'} ] top or bottom flag, tells algorithm to fit the polynomials, y = P(x), to the top or bottom of the data cloud.

         tsqlim:   [ 0.99 ] limit that governs whether a data point is significantly outside the fit residual defined by input res.

       stopcrit:   [1e-4 1e-4 1000 360] stopping criteria, iteration is continued until one of the stopping criterion is met: [(relative tolerance) (absolute tolerance) (maximum number of iterations) (maximum time [seconds])].

See Also

baseline, lamsel, lsq2top, mscorr, savgol, stdfir, wlsbaseline


< baseline browse >