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 respiration features
18 %> @param EEGsignal: the respiration signal.
19 %> @param varargin: you can choose which features to extract (see featureSelector)
20 %> the list of available features is:
21 %> - SP_delta:power spectral power
for delta band <4Hz
22 %> - SP_theta: power spectral power
for theta band [4,8[ Hz
23 %> - SP_slowAlpha: power spectral power
for slow alpha band [8,[10 Hz
24 %> - SP_alpha: power spectral power
for alpha band [8,12[ Hz
25 %> - SP_beta: power spectral power
for beta band [12,30[ Hz
26 %> - SP_gamma: power spectral power
for gamma band >30Hz
28 %> @retval EEG_feats: list of features values
29 %> @retval EEG_feats_names: names of the computed features (it is good pratice to
30 %> check
this vector since the order of requested features
31 %> can be different than the requested one)
32 %> the features are per electode and therefore 1xN (N= number of electrodes)
33 %> and the
final output is a 2dimensional array whose size is N_features x N_electrodes
35 %> @author Copyright Mohammad Soleymani, Guillaume Chanel, Frank Villaro-Dixon, 2015
36 function [EEG_feats, EEG_feats_names] =
EEG_feat_extr(EEGsignal,varargin)
38 % Check inputs and define unknown values
41 %Make sure we have a EEG signal
46 warning(
'The signal was baselined/relative, are you sure you want that ?');
50 % Define full feature list and get features selected by user
51 featuresNames = {
'SP_delta',
'SP_theta',
'SP_slowAlpha',
'SP_alpha',
'SP_beta',
'SP_gamma'};
55 %If some features are selected
56 if(~isempty(EEG_feats_names))
57 if any(strncmp(
'SP',EEG_feats_names,2))
58 %calculating spectral power features in different bands
59 [SP_delta, SP_theta, SP_slowAlpha, SP_alpha, SP_beta, SP_gamma] =
EEG_feat_bandENR(EEGsignal);
62 for (i = 1:length(EEG_feats_names))
63 eval([
'EEG_feats(i,:) = ' EEG_feats_names{i}
''';
']);
66 else %no features selected