Advertisement
Guest User

Untitled

a guest
Nov 28th, 2014
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement