Changes in / [70585a5:b050e8e]
- Files:
-
- 1 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified .bzrignore ¶
r70585a5 rb050e8e 5 5 **/*.lo 6 6 **/*.la 7 8 # gcov generated files9 **/*.gcno10 **/*.gcda11 7 12 8 # ignore compiled examples … … 38 34 configure 39 35 depcomp 40 mkinstalldirs41 36 install-sh 42 37 libtool -
TabularUnified Makefile.am ¶
r70585a5 rb050e8e 36 36 uninstall-hook: uninstall-pkgconfig 37 37 38 lcov: all39 mkdir -p $(top_builddir)/lcov40 lcov --directory $(top_builddir) --output-file $(top_builddir)/lcov/aubio.info --compat-libtool --zerocounters41 cd tests/python && ./run_all_tests -v || echo "some tests failed"42 lcov --directory $(top_builddir) --output-file $(top_builddir)/lcov/aubio.info --compat-libtool --capture43 genhtml --output-directory $(top_builddir)/lcov $(top_builddir)/lcov/aubio.info -
TabularUnified configure.ac ¶
r70585a5 rb050e8e 35 35 dnl Enable debugging (no) 36 36 AC_ARG_ENABLE(debug, 37 AC_HELP_STRING([--enable-debug],[compile in debug mode [[default=no]]]),37 [ --enable-debug[[=value]] compile with debug [[default=no]]], 38 38 with_debug="yes", 39 39 with_debug="no") … … 46 46 dnl Enable full warnings (yes) 47 47 AC_ARG_ENABLE(warnings, 48 AC_HELP_STRING([--enable-warnings],[compile with all gcc warnings [[default=yes]]]),48 [ --enable-warnings[[=value]] compile with all gcc warnings [[default=yes]]], 49 49 with_warnme="no", 50 50 with_warnme="yes") … … 67 67 fi 68 68 69 dnl fail on compilation warnings70 69 AC_ARG_ENABLE(errorfail, 71 AC_HELP_STRING([--enable-errorfail],[fail on compilation warnings [[default=no]]]),70 [ --enable-errorfail[[=value]] fail on compilation warnings [[default=no]]], 72 71 AUBIO_CFLAGS="$AUBIO_CFLAGS -Werror -Wmissing-prototypes -Wmissing-declarations -Wno-unused-parameter", 73 with_errorfail="no") 74 75 dnl add gcov/lcov profiling and coverage flags 76 AC_ARG_ENABLE(lcov, 77 AC_HELP_STRING([--enable-lcov],[compile with gcov/lcov profiling flags [[default=no]]]), 78 AUBIO_CFLAGS="$AUBIO_CFLAGS -fprofile-arcs -ftest-coverage", 79 with_lcov="no") 72 with_warnme="no") 80 73 81 74 dnl Check for libtool -
TabularUnified examples/aubioonset.c ¶
r70585a5 rb050e8e 72 72 if (isonset && output_filename == NULL) { 73 73 if(frames >= 4) { 74 outmsg("%f\n",(frames- frames_delay)*overlap_size/(float)samplerate);75 } else if (frames < frames_delay) {74 outmsg("%f\n",(frames-4)*overlap_size/(float)samplerate); 75 } else if (frames < 4) { 76 76 outmsg("%f\n",0.); 77 77 } … … 80 80 81 81 int main(int argc, char **argv) { 82 frames_delay = 4;83 82 examples_common_init(argc,argv); 84 83 examples_common_process(aubio_process,process_print); -
TabularUnified examples/utils.c ¶
r70585a5 rb050e8e 22 22 void save_data (void); 23 23 void restore_data(lash_config_t * lash_config); 24 void flush_process(aubio_process_func_t process_func, aubio_print_func_t print);25 24 pthread_t lash_thread; 26 25 #endif /* LASH_SUPPORT */ … … 34 33 int usejack = 0; 35 34 int usedoubled = 1; 36 int frames_delay = 0;37 35 38 36 … … 397 395 398 396 debug("Processed %d frames of %d samples.\n", frames, buffer_size); 399 400 flush_process(process_func, print);401 397 del_aubio_sndfile(file); 402 398 … … 407 403 } 408 404 409 void flush_process(aubio_process_func_t process_func, aubio_print_func_t print){410 uint i,j;411 for (i = 0; i < channels; i++) {412 for (j = 0; j < obuf->length; j++) {413 fvec_write_sample(obuf,0.,i,j);414 }415 }416 for (i = 0; (signed)i < frames_delay; i++) {417 process_func(ibuf->data, obuf->data, overlap_size);418 print();419 }420 }421 405 422 406 -
TabularUnified examples/utils.h ¶
r70585a5 rb050e8e 42 42 extern int usejack; 43 43 extern int usedoubled; 44 extern int frames_delay;45 44 extern unsigned int median; 46 45 extern const char * output_filename; -
TabularUnified src/fft.c ¶
r70585a5 rb050e8e 46 46 uint_t fft_size; 47 47 real_t *in, *out; 48 fftw_plan pfw, pbw;48 fftw_plan pfw, pbw; 49 49 fft_data_t * specdata; /* complex spectral data */ 50 50 fvec_t * compspec; … … 61 61 /* create plans */ 62 62 #ifdef HAVE_COMPLEX_H 63 s->fft_size = winsize/2 +1;63 s->fft_size = winsize/2+1; 64 64 s->specdata = (fft_data_t*)fftw_malloc(sizeof(fft_data_t)*s->fft_size); 65 65 s->pfw = fftw_plan_dft_r2c_1d(winsize, s->in, s->specdata, FFTW_ESTIMATE); … … 102 102 } 103 103 fftw_execute(s->pfw); 104 #if defHAVE_COMPLEX_H104 #if HAVE_COMPLEX_H 105 105 compspec->data[i][0] = REAL(s->specdata[0]); 106 106 for (j = 1; j < s->fft_size -1 ; j++) { … … 121 121 const smpl_t renorm = 1./(smpl_t)s->winsize; 122 122 for (i = 0; i < compspec->channels; i++) { 123 #if defHAVE_COMPLEX_H123 #if HAVE_COMPLEX_H 124 124 s->specdata[0] = compspec->data[i][0]; 125 125 for (j=1; j < s->fft_size - 1; j++) { -
TabularUnified src/onsetdetection.c ¶
r70585a5 rb050e8e 284 284 } 285 285 286 void aubio_onsetdetection_free (aubio_onsetdetection_t *o){ 287 del_aubio_onsetdetection(o); 288 } 289 286 290 void del_aubio_onsetdetection (aubio_onsetdetection_t *o){ 287 291 -
TabularUnified src/onsetdetection.h ¶
r70585a5 rb050e8e 161 161 */ 162 162 void del_aubio_onsetdetection(aubio_onsetdetection_t *o); 163 /** deletion of an onset detection object (obsolete) 164 165 \param o onset detection object as returned by new_aubio_onsetdetection() 166 167 */ 168 void aubio_onsetdetection_free(aubio_onsetdetection_t *o); 169 163 170 164 171 #ifdef __cplusplus -
TabularUnified src/pitchyinfft.c ¶
r70585a5 rb050e8e 138 138 } 139 139 } else 140 return 0 .;140 return 0; 141 141 } 142 142 -
TabularUnified swig/aubio.i ¶
r70585a5 rb050e8e 178 178 aubio_onsetdetection_t * new_aubio_onsetdetection(aubio_onsetdetection_type type, uint_t size, uint_t channels); 179 179 void aubio_onsetdetection(aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset); 180 void aubio_onsetdetection_free(aubio_onsetdetection_t *o); 180 181 181 182 /* should these still be exposed ? */ -
TabularUnified tests/src/Makefile.am ¶
r70585a5 rb050e8e 7 7 bin_PROGRAMS = \ 8 8 test-fft \ 9 test-mfft \ 9 10 test-hist \ 10 11 test-scale \ -
TabularUnified tests/src/test-fft.c ¶
r70585a5 rb050e8e 1 1 #include <stdlib.h> 2 #include <math.h> 3 #include <complex.h> 2 4 #include <aubio.h> 3 5 6 #define NEW_ARRAY(_t,_n) (_t*)malloc((_n)*sizeof(_t)) 7 8 4 9 int main(){ 5 /* allocate some memory */ 6 uint_t win_s = 4096; /* window size */ 7 uint_t channels = 100; /* number of channels */ 8 fvec_t * in = new_fvec (win_s, channels); /* input buffer */ 9 cvec_t * fftgrain = new_cvec (win_s, channels); /* fft norm and phase */ 10 fvec_t * out = new_fvec (win_s, channels); /* output buffer */ 11 /* allocate fft and other memory space */ 12 aubio_fft_t * fft = new_aubio_fft(win_s,channels); 13 /* fill input with some data */ 14 //printf("initialised\n"); 15 /* execute stft */ 16 aubio_fft_do (fft,in,fftgrain); 17 //printf("computed forward\n"); 18 /* execute inverse fourier transform */ 19 aubio_fft_rdo(fft,fftgrain,out); 20 //printf("computed backard\n"); 10 uint_t i,j; 11 uint_t win_s = 1024; // window size 12 uint_t channels = 1; // number of channel 13 fvec_t * in = new_fvec (win_s, channels); // input buffer 14 cvec_t * fftgrain = new_cvec (win_s, channels); // fft norm and phase 15 fvec_t * out = new_fvec (win_s, channels); // output buffer 16 17 // allocate fft and other memory space 18 aubio_fft_t * fft = new_aubio_fft(win_s); // fft interface 19 smpl_t * w = NEW_ARRAY(smpl_t,win_s); // window 20 // complex spectral data 21 fft_data_t ** spec = NEW_ARRAY(fft_data_t*,channels); 22 for (i=0; i < channels; i++) 23 spec[i] = NEW_ARRAY(fft_data_t,win_s); 24 // initialize the window (see mathutils.c) 25 aubio_window(w,win_s,aubio_win_hanningz); 26 27 // fill input with some data 28 in->data[0][win_s/2] = 1; 29 30 // execute stft 31 for (i=0; i < channels; i++) { 32 aubio_fft_do (fft,in->data[i],spec[i],win_s); 33 // put norm and phase into fftgrain 34 aubio_fft_getnorm(fftgrain->norm[i], spec[i], win_s/2+1); 35 aubio_fft_getphas(fftgrain->phas[i], spec[i], win_s/2+1); 36 } 37 38 // execute inverse fourier transform 39 for (i=0; i < channels; i++) { 40 for (j=0; j<win_s/2+1; j++) { 41 spec[i][j] = cexp(I*aubio_unwrap2pi(fftgrain->phas[i][j])); 42 spec[i][j] *= fftgrain->norm[i][j]; 43 } 44 aubio_fft_rdo(fft,spec[i],out->data[i],win_s); 45 } 46 47 del_fvec(in); 48 del_fvec(out); 49 del_cvec(fftgrain); 50 free(w); 21 51 del_aubio_fft(fft); 22 del_fvec(in); 23 del_cvec(fftgrain); 24 del_fvec(out); 25 //printf("memory freed\n"); 52 for (i=0; i < channels; i++) 53 free(spec[i]); 54 free(spec); 26 55 aubio_cleanup(); 27 56 return 0;
Note: See TracChangeset
for help on using the changeset viewer.