TEAP (Toolbox for Emotion Analysis using Physiological Signals) doc
HST_aqn_variable.m
Go to the documentation of this file.
1 %This file is part of TEAP.
2 %
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.
7 %
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.
12 %
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/>.
15 %
16 %> @file HST_aqn_variable.m
17 %> @brief HST_aqn_variable gets a HST signal from a variable
18 %
19 %> @param rawHST [1xN] the raw HST signal
20 %> @param sampRate [1x1] the sampling rate, in Hz
21 %> @retval Signal A HST TEAP signal
22 %
23 %> Copyright Frank Villaro-Dixon, 2014
24 function Signal = HST_aqn_variable(rawHST, sampRate)
25 
26 
27 if(nargin ~= 2)
28  error('Usage: HST_aqn_variable(rawHST, sampRate)');
29 end
30 
31 Signal = HST__new_empty();
32 Signal = Signal__set_samprate(Signal, sampRate);
33 
34 if(median(rawHST) > 70)
35  warning(['The signal given seems to be given in °F. I need °C ! ' ...
36  'Automatic conversion applied. ' ...
37  'And stop using Fahrenheit, nobody uses it anyway !']);
38  rawHST = (rawHST - 32) .* (5/9);
39 end
40 
41 if(median(rawHST) < 4 && median(rawHST) > -4) %we may have a relative signal
42  Signal = Signal__set_absolute(Signal, false);
43 elseif(median(rawHST) < 20 || median(rawHST) > 45)
44  error(['Something seems wrong with the HST signal: temperatures outside' ...
45  ' range (20; 54)']);
46 end
47 
48 
49 Signal = Signal__set_raw(Signal, Raw_convert_1D(rawHST));
50 
51 %And, we filter the signal, else it's useless
52 Signal = HST_filter_basic(Signal);
53 
Signal__set_absolute
function Signal__set_absolute(in Signal, in isAbsolute)
Signal__set_raw
function Signal__set_raw(in Signal, in raw)
Raw_convert_1D
function Raw_convert_1D(in Raw)
HST_filter_basic
function HST_filter_basic(in HSTSignal)
HST__new_empty
function HST__new_empty()
Signal__set_samprate
function Signal__set_samprate(in Signal, in samprate)
HST_aqn_variable
function HST_aqn_variable(in rawHST, in sampRate)
Copyright Frank Villaro-Dixon, 2014.