diff options
author | Jamie Bullock <jamie@jamiebullock.com> | 2013-05-31 22:44:03 +0100 |
---|---|---|
committer | Jamie Bullock <jamie@jamiebullock.com> | 2013-05-31 22:50:18 +0100 |
commit | 7b4c50a8d9087a57a6af27ca0ae3eb30d35aae43 (patch) | |
tree | 50afdbdeca49923cff79c3ac634baaf159c88143 /src/scalar.c | |
parent | 962c5fe017b588f59b21585c847ef6b67898cbf7 (diff) | |
download | LibXtract-7b4c50a8d9087a57a6af27ca0ae3eb30d35aae43.tar.gz LibXtract-7b4c50a8d9087a57a6af27ca0ae3eb30d35aae43.tar.bz2 LibXtract-7b4c50a8d9087a57a6af27ca0ae3eb30d35aae43.zip |
Add wavelet-based pitch tracker
Diffstat (limited to 'src/scalar.c')
-rw-r--r-- | src/scalar.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/scalar.c b/src/scalar.c index 4675c4c..d35f12b 100644 --- a/src/scalar.c +++ b/src/scalar.c @@ -28,9 +28,12 @@ #include <stdio.h> #include <math.h> -#include "../xtract/libxtract.h" -#include "../xtract/xtract_helper.h" +#include "dywapitchtrack/dywapitchtrack.h" + +#include "xtract/libxtract.h" +#include "xtract/xtract_helper.h" #include "xtract_macros_private.h" +#include "xtract_globals_private.h" int xtract_mean(const double *data, const int N, const void *argv, double *result) { @@ -953,7 +956,6 @@ int xtract_failsafe_f0(const double *data, const int N, const void *argv, double if(return_code == XTRACT_NO_RESULT) { - sr = *(double *)argv; if(sr == 0) sr = 44100.0; @@ -975,3 +977,18 @@ int xtract_failsafe_f0(const double *data, const int N, const void *argv, double } +int xtract_wavelet_f0(const double *data, const int N, const void *argv, double *result) +{ + double sr = *(double *)argv; + + *result = dywapitch_computepitch(&wavelet_f0_state, data, 0, N); + + if (*result == 0.0) + { + return XTRACT_NO_RESULT; + } + + return XTRACT_SUCCESS; +} + + |