TEAP (Toolbox for Emotion Analysis using Physiological Signals) doc
GSR_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 GSR_aqn_variable.m
17 %> @brief GSR_aqn_variable gets a GSR signal from a variable
18 %
19 %> @param rawGSR [1xN]: the raw GSR signal
20 %> @param sampRate [1x1]: the sampling rate, in Hz
21 %
22 %> @retval Signal: A GSR TEAP signal
23 %
24 %> @author Copyright Frank Villaro-Dixon, 2014
25 function Signal = GSR_aqn_variable(rawGSR, sampRate)
26 
27 if(nargin ~= 2)
28  error('Usage: GSR_aqn_variable(rawGSR, sampRate)');
29 end
30 
31 
32 Signal = GSR__new_empty();
33 Signal = Signal__set_samprate(Signal, sampRate);
34 
35 %If it is given in Siemens
36 if(min(rawGSR) >= 0 && max(rawGSR) < 1)
37  warning(['The signal given seems to be given in Siemens. I need Ohms. ' ...
38  'Automatic conversion applied']);
39  rawGSR = 1./rawGSR;
40 elseif(min(rawGSR) < 0) %if the signal was baselined/relatived
41  Signal = Signal__set_absolute(Signal, false);
42 end
43 
44 
45 Signal = Signal__set_raw(Signal, Raw_convert_1D(rawGSR));
46 
47 %And we filter the signal. Else, it's useless
48 Signal = GSR_filter_basic(Signal);
49 
50 end
51 
Signal__set_absolute
function Signal__set_absolute(in Signal, in isAbsolute)
Signal__set_raw
function Signal__set_raw(in Signal, in raw)
GSR_aqn_variable
function GSR_aqn_variable(in rawGSR, in sampRate)
GSR__new_empty
function GSR__new_empty()
Raw_convert_1D
function Raw_convert_1D(in Raw)
Signal__set_samprate
function Signal__set_samprate(in Signal, in samprate)