From 6a4be601746f6a84fc70434a61b16bea86b6c147 Mon Sep 17 00:00:00 2001 From: Jamie Bullock Date: Sun, 4 May 2008 11:02:40 +0000 Subject: Fixed bug in peak interpolation algorithm in xtract_peak_spectrum() --- src/vector.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/vector.c') diff --git a/src/vector.c b/src/vector.c index 449cd0d..b891111 100644 --- a/src/vector.c +++ b/src/vector.c @@ -436,7 +436,7 @@ int xtract_peak_spectrum(const float *data, const int N, const void *argv, float for(n = 1; n < N; n++){ if(input[n] >= threshold){ if(input[n] > input[n - 1] && input[n] > input[n + 1]){ - result[N + n] = q * (n + (p = .5 * (y = input[n-1] - + result[N + n] = q * (n + (p = .5 * ((y = input[n-1]) - (y3 = input[n+1])) / (input[n - 1] - 2 * (y2 = input[n]) + input[n + 1]))); result[n] = y2 - .25 * (y - y3) * p; -- cgit v1.2.3