aboutsummaryrefslogtreecommitdiff
path: root/flib
diff options
context:
space:
mode:
authorJamie Bullock <postlude@users.sourceforge.net>2006-04-07 19:59:03 +0000
committerJamie Bullock <postlude@users.sourceforge.net>2006-04-07 19:59:03 +0000
commit868a2997a2739ca64ead0e6eb8f0240c3fdec413 (patch)
tree29761c2c6aae4103bae59c528e3adcbccce9b740 /flib
parent7e39c6cd5e9a93f18990b2d8fbe32ec522eef426 (diff)
Tidied.
svn path=/trunk/externals/postlude/; revision=4842
Diffstat (limited to 'flib')
-rw-r--r--flib/src/cross~.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/flib/src/cross~.c b/flib/src/cross~.c
index d769e54..45c3ed4 100644
--- a/flib/src/cross~.c
+++ b/flib/src/cross~.c
@@ -18,6 +18,8 @@
/*Calculate the (non optimized) cross correlation of two signal vectors*/
+/*Based on code by Phil Bourke */
+
#include "flib.h"
#define SQ(a) (a * a)
@@ -76,22 +78,7 @@ static t_int *cross_perform(t_int *w)
j %= N;
sxy += (x[i] - mx) * (y[j] - my);
-
- /*
- if (j < 0 || j >= N)
- continue;
- else
- sxy += (x[i] - mx) * (y[j] - my);
- */
-
-
- /* Or should it be (?)
- if (j < 0 || j >= n)
- sxy += (x[i] - mx) * (-my);
- else
- sxy += (x[i] - mx) * (y[j] - my);
- */
- }
+ }
r = sxy / denom;
*out++ = r;
/* r is the correlation coefficient at "delay" */