Mercurial > hg > libxtract
changeset 124:fc4bc58b92da
- fixed xtract_spread() -- now just calls xtract_spectral_variance()
author | Jamie Bullock <jamie@postlude.co.uk> |
---|---|
date | Thu, 31 Mar 2011 12:22:29 +0000 |
parents | efb1c1ae2ba8 |
children | 2bdf5e248870 |
files | src/scalar.c |
diffstat | 1 files changed, 1 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/src/scalar.c Wed Mar 30 10:51:39 2011 +0000 +++ b/src/scalar.c Thu Mar 31 12:22:29 2011 +0000 @@ -411,24 +411,7 @@ 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){