SHOW:
|
|
- or go back to the newest paste.
1 | zeroCrossCounter(double input, double thresh){ | |
2 | static double xzc; | |
3 | static double xc; | |
4 | ||
5 | int ysgn = hsgn(input, thresh); | |
6 | int xzc = kzc(ysgn, xzc); | |
7 | int yzc = hzc(ysgn, xzc); | |
8 | int xc = kc(yzc, xc); | |
9 | return 0; | |
10 | } | |
11 | ||
12 | int hsgn(double input, double thresh){ | |
13 | int ret; | |
14 | if(input > math.abs(thresh)) | |
15 | ret = 1; | |
16 | else if(input < math.abs(thresh)) | |
17 | ret = -1; | |
18 | else | |
19 | ret = 0; | |
20 | ||
21 | return ret; | |
22 | } |