From 868a2997a2739ca64ead0e6eb8f0240c3fdec413 Mon Sep 17 00:00:00 2001 From: Jamie Bullock Date: Fri, 7 Apr 2006 19:59:03 +0000 Subject: Tidied. svn path=/trunk/externals/postlude/; revision=4842 --- flib/src/cross~.c | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) (limited to 'flib') 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" */ -- cgit v1.2.1