comparison src/scalar.c @ 241:66ebf1399a29

Fix bug in xtract_peak()
author Jamie Bullock <jamie@jamiebullock.com>
date Thu, 05 Jun 2014 20:30:08 +0100
parents f7a7a54e9de4
children 8fc9a0462c6e
comparison
equal deleted inserted replaced
240:a1c83801f973 241:66ebf1399a29
1035 maximum = data[n]; 1035 maximum = data[n];
1036 } 1036 }
1037 } 1037 }
1038 1038
1039 average /= (double)N; 1039 average /= (double)N;
1040 1040
1041 if (current != maximum) 1041 if (current != maximum)
1042 { 1042 {
1043 return XTRACT_NO_RESULT; 1043 return XTRACT_NO_RESULT;
1044 } 1044 }
1045 1045
1046 if (current < average + threshold) 1046 if (current < average + threshold)
1047 { 1047 {
1048 return XTRACT_NO_RESULT; 1048 return XTRACT_NO_RESULT;
1049 } 1049 }
1050 1050
1051 return XTRACT_SUCCESS; 1051 *result = current;
1052 1052
1053 } 1053 return XTRACT_SUCCESS;
1054 1054
1055 1055 }
1056
1057