File tree Expand file tree Collapse file tree 1 file changed +43
-1
lines changed Expand file tree Collapse file tree 1 file changed +43
-1
lines changed Original file line number Diff line number Diff line change 11"""These functions compute RETROICOR regressors (Glover et al. 2000)."""
2+ # import file
23import numpy as np
34
45from .. import references
56from ..due import due
67
78
8- pass
9+ def std (signal ):
10+ """
11+ Calculate standard deviation across input channels of signal.
12+
13+ Parameters
14+ ----------
15+ std : function
16+ Calculate standard deviation across input channels.
17+ args : signal (X, n) :obj:`numpy.ndarray`
18+ ND array with signal of some human biometric data, hopefully from a living human.
19+ signal, of shape (n_channels, )
20+
21+ Returns
22+ -------
23+ N-sized array :obj:`numpy.ndarray`
24+ Standard deviation of signal.
25+ """
26+ std_val = np .std (signal , axis = 0 )
27+ return std_val
28+
29+
30+ def tSNR (signal ):
31+ """
32+ Calculate temporal signal to noise ration of signal.
33+
34+ Parameters
35+ ----------
36+ tSNR : function
37+ Calculate temporal signal to noise ratio.
38+ args : signal
39+ ND array with signal of some human biometric data, hopefully from a living human.
40+
41+ Returns
42+ -------
43+ N-sized array :obj:`numpy.ndarray`
44+ Temporal signal to noise ratio of signal.
45+ """
46+ me = np .mean (signal , axis = 0 )
47+ std = np .std (signal , axis = 0 )
48+ tSNR_val = me / std
49+ return tSNR_val
50+
You can’t perform that action at this time.
0 commit comments