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/>.
16 %> @file GSR_feat_peaks_example.m
17 %> @brief Loads a GSR signal, computes it
's attributes and displays the signal
19 %Before all, load TEAP
20 addpath(genpath('../../../
'))
22 %Then, we load some data:
23 data = csvread('GSR_example.csv
');
24 data = data'; %put in horizontal form
27 %Create the signal, the sampling freq of the signal we have is 1024Hz
30 %Clean the signal a bit
33 %And compute the features:
39 %As now the axis are in seconds, we have to use
this function to plot the points
42 %Note that we didn
't had to 'hold on
': the function does-it itself.
45 %Take a part of a signal, between 41 and 85 seconds
47 truncated = Signal__get_window(signal, 41, 85);
48 Signal_plot(truncated);
50 [nbPeaks ampPeaks riseTime posPeaks] = GSR_feat_peaks(truncated);
51 rawSig = Signal__get_raw(truncated);
52 Signal_plot_pts(truncated, posPeaks, rawSig(posPeaks), 'r*
');