TEAP (Toolbox for Emotion Analysis using Physiological Signals) doc
ECG_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 ECG_aqn_variable.m
17 %> @brief ECG_aqn_variable gets an ECG signal from a variable
18 %> @attention USAGE:
19 %> If you've got the signal from the 2 electrodes, you must call the function
20 %> like that:
21 %> @c ECG_aqn_variable(electrode1, electrode2, sampRate);
22 %> If, however, the difference was already calculated by your device, you can
23 %> call the function that way:
24 %> @c ECG_aqn_variable(electrodesDiff, sampRate);
25 %
26 %> @param ECG [1xN]: the ECG signal
27 %> @param ECG2 [1xN]: the other pair ECG signal (optional if difference already calc.)
28 %> @param sampRate [1x1]: the sampling rate, in Hz
29 %
30 %> @retval Signal: An ECG TEAP signal
31 %
32 %> @author Copyright Frank Villaro-Dixon, 2014
33 function Signal = ECG_aqn_variable(ECG, ECG2, sampRate)
34 
35 Signal = ECG__new_empty();
36 
37 if(nargin == 2) %second case
38  sampRate = ECG2;
39  raw = ECG;
40 elseif(nargin == 3) %first case
41  raw = ECG2 - ECG;
42 else
43  error('Usage: ECG_aqn_variable(ECG [, ECG2], sampRate)');
44 end
45 
46 Signal = Signal__set_samprate(Signal, sampRate);
47 Signal = Signal__set_raw(Signal, raw);
48 
49 end
50 
ECG_aqn_variable
function ECG_aqn_variable(in ECG, in ECG2, in sampRate)