IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
demo_pre_bc_rubber.m
Go to the documentation of this file.
1 %> @brief Demonstrates the Convex Polynomial Line baseline correction
2 %> @ingroup demo
3 %> @file
4 
6 
7 opre = pre_bc_rubber();
8 opre.flag_trim = 0;
9 
10 y = opre.use(x);
11 
12 figure;
13 fig_assert();
14 global SCALE;
15 SCALE = 1;
16 draw_zero_line(x.fea_x);
17 hold on;
18 h = [];
19 h(1) = plot(x.fea_x, x.X, 'LineWidth', 4, 'Color', 'r');
20 h(2) = plot(x.fea_x, x.X-y.X, 'LineWidth', 4, 'Color', 'k');
21 h(3) = plot(x.fea_x, y.X, 'LineWidth', 4, 'Color', [0, 0.65, 0]);
22 legend(h, {'Original', 'Baseline', 'Corrected'});
23 title('Rubberband baseline correction demonstration');
24 format_xaxis(x);
25 format_frank();
26 make_box();
27 maximize_window([], [], 0.6);
28 save_as_png([], 'irr_bc_rubber');
function make_box()
Convex Polygonal Line (Rubberband-like) Baseline Correction.
Definition: pre_bc_rubber.m:8
function load_data_uglyspectrum()
function maximize_window(in h, in aspectratio, in normalizedsize)
function save_as_png(in h, in fn, in dpi)
function format_frank(in F, in scale, in handles)
function draw_zero_line(in x, in linewidth)
function fig_assert()
function format_xaxis(in par)