1 %This file is part of TEAP.
3 %TEAP is free software: you can redistribute it and/or modify
4 %it under the terms of the GNU General Public License as published by
5 %the Free Software Foundation, either version 3 of the License, or
6 %(at your option) any later version.
8 %TEAP is distributed in the hope that it will be useful,
9 %but WITHOUT ANY WARRANTY; without even the implied warranty of
10 %MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 %GNU General Public License
for more details.
13 %You should have received a copy of the GNU General Public License
14 %along with TEAP. If not, see <http://www.gnu.org/licenses/>.
17 %> @brief Computes Skin temperature features
18 %> @b WARNING:
this function will give
'strange' results when applied on a relative
21 %> @param HSTsignal the temperature signal.
22 %> @param varargin you can choose which features to extract (see featureSelector)
23 %> the list of available features is:
24 %> - mean_: average temprature
25 %> - std_: standard deviation of the temperature
26 %> - kurtosis_: Kurtosis of the temperature
27 %> - skewness_: skewness of the temperature
28 %> - sp0001: Spectral power 0-0.1Hz,
29 %> - sp0102: Spectral power 0.1-0.2Hz,
31 %> @retval HST_feats list of features values
32 %> @retval HST_feats_names names of the computed features (it is good pratice to
33 %> check
this vector since the order of requested features
34 %> can be different than the requested one)
35 %> @author Copyright Frank Villaro-Dixon, 2015
38 function [HST_feats, HST_feats_names] =
HST_feat_extr(HSTsignal,varargin)
40 % Check inputs and define unknown values
43 %Make sure we have a HST signal
48 warning([
'For the function to work well, you should low-pass the signal' ...
49 '. Preferably with a mean filter']);
53 warning(
'The signal was baselined/relative, are you sure you want that ?');
57 % Define full feature list and get features selected by user
58 featuresNames = {
'mean_',
'std_',
'kurtosis_',
'skewness_',
'sp0001',
'sp0102'};
61 %If some features are selected
62 if(~isempty(HST_feats_names))
65 if any(strcmp(
'mean_',HST_feats_names)) || any(strcmp(
'std_',HST_feats_names)) || any(strcmp(
'kurtosis_',HST_feats_names)) || any(strcmp(
'skewness_',HST_feats_names))
68 %spectral power features in bands; these two bands are chosen due to
69 %the low frequency content in
this signal
70 if any(strncmp(
'sp',HST_feats_names,2))
71 bands = [0, 0.1; 0.1, 0.2];
73 sp0001 = powerBands(1);
74 sp0102 = powerBands(2);
76 %Write the values to the final vector output
77 for (i = 1:length(HST_feats_names))
78 eval(['HST_feats(i) = ' HST_feats_names{i}
';']);
80 else %no features selected