diff src/vector.c @ 117:2b2d0609e44f

Fixed bug in peak interpolation algorithm in xtract_peak_spectrum()
author Jamie Bullock <jamie@postlude.co.uk>
date Sun, 04 May 2008 11:02:40 +0000
parents 6c5ece9cba3a
children 75e14c9881ee
line wrap: on
line diff
--- a/src/vector.c	Wed Mar 26 13:04:33 2008 +0000
+++ b/src/vector.c	Sun May 04 11:02:40 2008 +0000
@@ -436,7 +436,7 @@
     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;