aboutsummaryrefslogtreecommitdiff
path: root/src/scalar.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/scalar.c')
-rw-r--r--src/scalar.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/scalar.c b/src/scalar.c
index c7d6edd..612fa3c 100644
--- a/src/scalar.c
+++ b/src/scalar.c
@@ -456,7 +456,7 @@ int xtract_lowest_value(const float *data, const int N, const void *argv, float
int n = N;
float temp;
- *result = data[N];
+ *result = data[--n];
while(n--){
if((temp = data[n]) > *(float *)argv)
@@ -470,7 +470,7 @@ int xtract_highest_value(const float *data, const int N, const void *argv, float
int n = N;
- *result = data[N];
+ *result = data[--n];
while(n--)
*result = MAX(*result, data[n]);
@@ -633,7 +633,7 @@ int xtract_failsafe_f0(const float *data, const int N, const void *argv, float *
magnitudes = (float *)malloc(N * sizeof(float));
peaks = (float *)malloc(N * sizeof(float));
- xtract_magnitude_spectrum(data, N, NULL, magnitudes);
+ xtract_magnitude_spectrum(data, N, argv, magnitudes);
argf[0] = 10.f;
argf[1] = *(float *)argv;
xtract_peaks(magnitudes, N, argf, peaks);