diff options
author | Jamie Bullock <jamie@jamiebullock.com> | 2013-01-07 16:27:15 +0000 |
---|---|---|
committer | Jamie Bullock <jamie@jamiebullock.com> | 2013-01-07 16:39:29 +0000 |
commit | 144e7f8668166ee1779ad304cc5ac94d8e525529 (patch) | |
tree | 089b2bbbcf15ee8bdde390a4d270e4812e7e2228 /src/delta.c | |
parent | 0f46938156dedf13032bdb1fc914a63d46bae558 (diff) | |
download | LibXtract-144e7f8668166ee1779ad304cc5ac94d8e525529.tar.gz LibXtract-144e7f8668166ee1779ad304cc5ac94d8e525529.tar.bz2 LibXtract-144e7f8668166ee1779ad304cc5ac94d8e525529.zip |
added Ooura implementation to repository
Diffstat (limited to 'src/delta.c')
-rw-r--r-- | src/delta.c | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/src/delta.c b/src/delta.c index b1effd0..9620294 100644 --- a/src/delta.c +++ b/src/delta.c @@ -1,5 +1,5 @@ /* libxtract feature extraction library - * + * * Copyright (C) 2006 Jamie Bullock * * This program is free software; you can redistribute it and/or modify @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, * USA. */ @@ -24,14 +24,16 @@ #include "xtract/libxtract.h" -int xtract_flux(const float *data, const int N, const void *argv , float *result){ +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); } -int xtract_lnorm(const float *data, const int N, const void *argv , float *result){ +int xtract_lnorm(const float *data, const int N, const void *argv , float *result) +{ int n, type; @@ -45,18 +47,20 @@ int xtract_lnorm(const float *data, const int N, const void *argv , float *resul *result = 0.f; - switch(type){ + switch(type) + { - case XTRACT_POSITIVE_SLOPE: - for(n = 0; n < N; n++){ - if(data[n] > 0) - *result += powf(data[n], order); - } - break; - default: - for(n = 0; n < N; n++) + case XTRACT_POSITIVE_SLOPE: + for(n = 0; n < N; n++) + { + if(data[n] > 0) *result += powf(data[n], order); - break; + } + break; + default: + for(n = 0; n < N; n++) + *result += powf(data[n], order); + break; } @@ -66,19 +70,22 @@ int xtract_lnorm(const float *data, const int N, const void *argv , float *resul } -int xtract_attack_time(const float *data, const int N, const void *argv , float *result){ +int xtract_attack_time(const float *data, const int N, const void *argv , float *result) +{ return XTRACT_FEATURE_NOT_IMPLEMENTED; } -int xtract_decay_time(const float *data, const int N, const void *argv, float *result){ +int xtract_decay_time(const float *data, const int N, const void *argv, float *result) +{ return XTRACT_FEATURE_NOT_IMPLEMENTED; } -int xtract_difference_vector(const float *data, const int N, const void *argv, float *result){ +int xtract_difference_vector(const float *data, const int N, const void *argv, float *result) +{ const float *frame1, *frame2; |