IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
pre_bc_rubber.m
Go to the documentation of this file.
1 %> @brief Convex Polygonal Line (Rubberband-like) Baseline Correction
2 %>
3 %> The algorithm is in bc_rubber.m
4 %>
5 %> @image html rubberlike_explain.png
6 %>
7 %> @sa bc_rubber.m, demo_pre_bc_rubber.m
8 classdef pre_bc_rubber < pre_bc
9  properties
10  %> =1. Whether to trim the first and last variables, which are going to stop being variables, anyway. There may be cases when this is
11  %> not desired, e.g. when the baseline correction is being carried out exclusively for visualization of the spectra, without any
12  %> further analysis.
13  flag_trim = 1;
14  end;
15 
16  methods
17  function o = pre_bc_rubber(o)
18  o.classtitle = 'Rubberband-like';
19  o.short = 'BCRubber';
20  o.flag_params = 1;
21  end;
22  end;
23 
24  methods(Access=protected)
25  %> Applies block to dataset
26  function data = do_use(o, data)
27  data.X = bc_rubber(data.X);
28 
29  if o.flag_trim
30  data = data.select_features(2:data.nf-1);
31  end;
32  end;
33  end;
34 end
function bc_rubber(in X)
Convex Polygonal Line (Rubberband-like) Baseline Correction.
Definition: pre_bc_rubber.m:8
Base Block class.
Definition: block.m:2
Baseline Correction base class.
Definition: pre_bc.m:2