-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphaseWeigh3D
More file actions
48 lines (35 loc) · 1.85 KB
/
phaseWeigh3D
File metadata and controls
48 lines (35 loc) · 1.85 KB
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
# Calculates the phase difference weight factors from phi1:2, phi1:3 and phi1:4 distributions for any PSR passed to it (whether SWC or SWD)
# phaseWeigh v.1.0
# phaseWeigh v.1.1 January 30, 2012
# Copyright (C) 2014 Christian Richard
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/gpl.html>.
# Author contact info:
# lifepupil@gmail.com
# UPDATE:
# 1. Now returns the scores for a PSR from each of the 3 phase difference distributions. Valuable for SWC characterization.
# UPDATE (2-28-13):
# 0. phaseWeigh3D v.1.0 (phaseWeigh v.2.0)
# 1. phaseWeigh3D is derived from and improvement over original phaseWeigh function
# UPDATE (5-10-13):
# 1. If there is no phase synchrony in ps12 then it previously wrote 0, however 0 is a valid phase degree, so modified so .ps12 files write -1 if no synch;
# added conditional in this function to detect when this occurs.
# UPDATE (7-10-13):
# Added line to permit either ps12 or pd12 signals to be passed to this function by making sure that values always fall between 0 and 359
# UPDATE (4-1-14):
# - stripped this function down to bare essentials
setproc phaseWeigh3D {{&signal p12} {&signal p13} {&signal p14} {&listv pd3D}} {
pdWeights = Zero(p12.size)
foreach w 0:pdWeights.size-1 {
pdWeights[w] = pd3D[p12[w]][p13[w];p14[w]]
}
return pdWeights
}