From 2c47459bdf912a30ba1c64c2bf538aaacf4c2aa2 Mon Sep 17 00:00:00 2001 From: Jamie Bullock Date: Thu, 31 Mar 2011 12:22:29 +0000 Subject: - fixed xtract_spread() -- now just calls xtract_spectral_variance() --- src/scalar.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'src/scalar.c') diff --git a/src/scalar.c b/src/scalar.c index 72422fb..a82dda0 100644 --- a/src/scalar.c +++ b/src/scalar.c @@ -411,24 +411,7 @@ int xtract_smoothness(const float *data, const int N, const void *argv, float *r int xtract_spread(const float *data, const int N, const void *argv, float *result){ - int n = N; - - float num = 0.f, den = 0.f, temp = 0.f; - - if(argv == NULL) - return XTRACT_BAD_ARGV; - - while(n--){ - temp = n - *(float *)argv; - num += XTRACT_SQ(temp) * data[n]; - 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; + return xtract_spectral_variance(data, N, argv, result); } int xtract_zcr(const float *data, const int N, const void *argv, float *result){ -- cgit v1.2.3