From: Paul Brossier Date: Thu, 1 Oct 2009 23:26:08 +0000 (+0200) Subject: tests/src/: various updates X-Git-Tag: bzr2git~225 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=38e973229558d1d2cee3b90d514e14daabf102a6;p=aubio.git tests/src/: various updates --- diff --git a/tests/src/test-fft.c b/tests/src/test-fft.c index 20d666fb..e43efa20 100644 --- a/tests/src/test-fft.c +++ b/tests/src/test-fft.c @@ -3,26 +3,33 @@ int main(){ /* allocate some memory */ - uint_t win_s = 4096; /* window size */ - uint_t channels = 100; /* number of channels */ + uint_t win_s = 8; /* window size */ + uint_t channels = 1; /* number of channels */ fvec_t * in = new_fvec (win_s, channels); /* input buffer */ cvec_t * fftgrain = new_cvec (win_s, channels); /* fft norm and phase */ fvec_t * out = new_fvec (win_s, channels); /* output buffer */ + in->data[0][0] = 1; + in->data[0][1] = 2; + in->data[0][2] = 3; + in->data[0][3] = 4; + in->data[0][4] = 5; + in->data[0][5] = 6; + in->data[0][6] = 5; + in->data[0][7] = 6; /* allocate fft and other memory space */ aubio_fft_t * fft = new_aubio_fft(win_s,channels); /* fill input with some data */ - //printf("initialised\n"); + fvec_print(in); /* execute stft */ aubio_fft_do (fft,in,fftgrain); - //printf("computed forward\n"); + cvec_print(fftgrain); /* execute inverse fourier transform */ aubio_fft_rdo(fft,fftgrain,out); - //printf("computed backard\n"); + fvec_print(out); del_aubio_fft(fft); del_fvec(in); del_cvec(fftgrain); del_fvec(out); - //printf("memory freed\n"); aubio_cleanup(); return 0; } diff --git a/tests/src/test-filterbank_mel.c b/tests/src/test-filterbank_mel.c index d1aaae3b..8218f1cf 100644 --- a/tests/src/test-filterbank_mel.c +++ b/tests/src/test-filterbank_mel.c @@ -1,3 +1,4 @@ +#include #include int @@ -25,7 +26,7 @@ main (void) //fvec_print (coeffs); - fprintf(stderr, "%f\n", vec_sum(coeffs)); + //fprintf(stderr, "%f\n", fvec_sum(coeffs)); aubio_filterbank_do (o, in, out); diff --git a/tests/src/test-mfcc.c b/tests/src/test-mfcc.c index 474db96b..8efc4d6f 100644 --- a/tests/src/test-mfcc.c +++ b/tests/src/test-mfcc.c @@ -21,7 +21,8 @@ main (void) } aubio_mfcc_do (o, in, out); - + fvec_print (out); + aubio_mfcc_do (o, in, out); fvec_print (out); del_aubio_mfcc (o);