diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/delta.c | 1 | ||||
-rw-r--r-- | src/scalar.c | 2 | ||||
-rw-r--r-- | src/vector.c | 2 |
3 files changed, 4 insertions, 1 deletions
diff --git a/src/delta.c b/src/delta.c index 25d380b..b1effd0 100644 --- a/src/delta.c +++ b/src/delta.c @@ -26,6 +26,7 @@ int xtract_flux(const float *data, const int N, const void *argv , float *result){ + /* FIX: don't be lazy -- take the lnorm of the difference vector! */ return xtract_lnorm(data, N, argv, result); } diff --git a/src/scalar.c b/src/scalar.c index 4a2b672..d2bc317 100644 --- a/src/scalar.c +++ b/src/scalar.c @@ -434,6 +434,8 @@ int xtract_spread(const float *data, const int N, const void *argv, float *resul den += data[n]; } + /* FIX: spectral spread is mathematically equivalent to spectral variance -- + * here we are computing the spectral standard deviation */ *result = sqrtf(num / den); return XTRACT_SUCCESS; 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; |