From 7b4c50a8d9087a57a6af27ca0ae3eb30d35aae43 Mon Sep 17 00:00:00 2001 From: Jamie Bullock Date: Fri, 31 May 2013 22:44:03 +0100 Subject: Add wavelet-based pitch tracker --- src/scalar.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'src/scalar.c') 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 #include -#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; +} + + -- cgit v1.2.3