-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathpspm_sf_auc.m
54 lines (52 loc) · 1.26 KB
/
pspm_sf_auc.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
function varargout = pspm_sf_auc(model, options)
% ● Description
% pspm_sf_auc returns the integral/area under the curve of an SCR time series
% ● Format
% auc = pspm_sf_auc(scr, sr, options)
% ● Arguments
% scr:
% sr:
% options:
% ● Outputs
% auc:
% ● Reference
% Bach DR, Friston KJ, Dolan RJ (2010). Analytic measures for the
% quantification of arousal from spontanaeous skin conductance
% fluctuations. International Journal of Psychophysiology, 76, 52-55.
% ● History
% Introduced In PsPM 3.0
% Written in 2008-2015 by Dominik R Bach (Wellcome Trust Centre for Neuroimaging)
% Maintained in 2022 by Teddy Chao (UCL)
%% initialise
global settings
if isempty(settings)
pspm_init;
end
sts = -1;
auc = [];
switch nargout
case 1
varargout{1} = auc;
case 2
varargout{1} = sts;
varargout{2} = auc;
end
%% check input arguments
if nargin < 1
warning('No data specified'); return;
end;
try model.scr; catch, warning('Input data is not defined.'); return; end
try model.sr; catch, warning('Sample rate is not defined.'); return; end
scr = model.scr;
sr = model.sr;
scr = scr - min(scr);
auc = mean(scr);
sts = 1;
switch nargout
case 1
varargout{1} = auc;
case 2
varargout{1} = sts;
varargout{2} = auc;
end
end