From: Amaury Hazan Date: Thu, 6 Sep 2007 00:33:11 +0000 (+0200) Subject: small adds X-Git-Tag: bzr2git~442^2~31^2~3 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=71d3bf0fb3571cbb616a0b1138e73a39fc41ffd1;p=aubio.git small adds --- diff --git a/examples/aubiomfcc.c b/examples/aubiomfcc.c index 3dcd2ab9..7366b3cc 100644 --- a/examples/aubiomfcc.c +++ b/examples/aubiomfcc.c @@ -40,11 +40,21 @@ int aubio_process(float **input, float **output, int nframes) { //compute mag spectrum aubio_pvoc_do (pv,ibuf, fftgrain); - + + uint_t coef_cnt; + uint_t n_filters=20; + smpl_t outbuf[20]; + + for (coef_cnt=0; coef_cntnorm, nframes, filterbank, outbuf); + for (coef_cnt=0; coef_cntfilters[n] = (smpl_t *)getbytes((buffer_size/2+1) * sizeof(smpl_t)); //populating the filter - new_aubio_mfcc(buffer_size, nyquist, XTRACT_EQUAL_GAIN, 80.0f, 18000.0f, mf->n_filters, mf->filters); + aubio_mfcc_init(buffer_size, nyquist, XTRACT_EQUAL_GAIN, lowfreq, highfreq, mf->n_filters, mf->filters); //process examples_common_process(aubio_process,process_print); diff --git a/src/Makefile.am b/src/Makefile.am index 1ca5d68f..bd952e21 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -21,7 +21,8 @@ pkginclude_HEADERS = aubio.h \ beattracking.h \ onset.h \ tempo.h \ - filter.h + filter.h + nodist_pkginclude_HEADERS = config.h lib_LTLIBRARIES = libaubio.la @@ -68,7 +69,7 @@ libaubio_la_SOURCES = aubio.h \ tempo.c \ tempo.h \ filter.c \ - filter.h + filter.h \ AM_CFLAGS = @AUBIO_CFLAGS@ @FFTWLIB_CFLAGS@ @SAMPLERATE_CFLAGS@ libaubio_la_LIBADD = @FFTWLIB_LIBS@ @SAMPLERATE_LIBS@ @LTLIBOBJS@ diff --git a/src/aubiofilterbank.c b/src/filterbank.c similarity index 99% rename from src/aubiofilterbank.c rename to src/filterbank.c index 6039998e..d6aa1e8d 100644 --- a/src/aubiofilterbank.c +++ b/src/filterbank.c @@ -20,7 +20,7 @@ */ -#include "aubiofilterbank.h" +#include "filterbank.h" // Initialization diff --git a/src/aubiofilterbank.h b/src/filterbank.h similarity index 100% rename from src/aubiofilterbank.h rename to src/filterbank.h diff --git a/src/mfcc.c b/src/mfcc.c index 4205b2c5..305125b0 100644 --- a/src/mfcc.c +++ b/src/mfcc.c @@ -22,7 +22,6 @@ #include "mffc.h" -#include "aubiofilterbank.h" // Computation @@ -59,4 +58,4 @@ int aubio_dct_do(const float *data, const int N, const void *argv, float *result fftwf_destroy_plan(plan); return XTRACT_SUCCESS; -} \ No newline at end of file +} diff --git a/src/mfcc.h b/src/mfcc.h index 856f77c7..c9251349 100644 --- a/src/mfcc.h +++ b/src/mfcc.h @@ -23,9 +23,7 @@ #ifndef MFCC_H #define MFCC_H -#include "aubiofilterbank.h" - -#define NYQUIST 22050.f +#include "filterbank.h" //libXtract enums // TODO: remove them