IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
fcon_maxminpos.m
Go to the documentation of this file.
1 %> @brief Maxima/minima detection
2 %>
3 %> Finds several maxima/minima within several ranges specified by the @c map property. The new variables will contain the values of the x-axis positions (wavenumbers) of each minimum/maximum detected.
4 %>
5 %> <h3>@c map example</h3>
6 %> @verbatim
7 %> o.map = [1670, 1620, 0; % Amide I
8 %> 1560, 1500, 0; % Amide II
9 %> 1468, 1435, 0; % Proteins
10 %> 1418, 1380, 0; % Proteins
11 %> 1260, 1215, 0; % Amide III
12 %> 1120, 1040, 0; % Various DNA/RNA
13 %> ]
14 %> @endverbatim
15 %
16 %> Uses peak_landmarks.m to convert multiple peak locations into features
17 %> @sa peak_landmarks.m
18 classdef fcon_maxminpos < fcon
19  properties
20  %> [wn11, wn12, flag_min1; wn21, wn22, flag_min2; ...]
21  map = [];
22  end;
23 
24  methods
25  function o = fcon_maxminpos(o)
26  o.classtitle = 'Maxima/minima Detection';
27  end;
28  end;
29 
30  methods(Access=protected)
31  function data = do_use(o, data)
32 
33  % Converts ranges of o.map (given in wavenumbers) to indexes
34  map_idx = o.map;
35  map_idx(:, 1:2) = v_x2ind(o.map(:, 1:2), data.fea_x);
36 
37  T = peak_landmarks(data.X, map_idx);
38 
39  data.X = T;
40  data.fea_x = 1:size(T, 2);
41  end;
42  end;
43 end
function v_x2ind(in v, in x)
Maxima/minima detection.
Feature Construction (FCon) base class.
Definition: fcon.m:2
function peak_landmarks(in X, in map, in t_range)