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