Changeset 70585a5
- Timestamp:
- Nov 21, 2007, 4:53:13 PM (17 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
- Children:
- 66a1b955
- Parents:
- b050e8e (diff), 15b97d9 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Files:
-
- 1 deleted
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
.bzrignore
rb050e8e r70585a5 5 5 **/*.lo 6 6 **/*.la 7 8 # gcov generated files 9 **/*.gcno 10 **/*.gcda 7 11 8 12 # ignore compiled examples … … 34 38 configure 35 39 depcomp 40 mkinstalldirs 36 41 install-sh 37 42 libtool -
Makefile.am
rb050e8e r70585a5 36 36 uninstall-hook: uninstall-pkgconfig 37 37 38 lcov: all 39 mkdir -p $(top_builddir)/lcov 40 lcov --directory $(top_builddir) --output-file $(top_builddir)/lcov/aubio.info --compat-libtool --zerocounters 41 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 --capture 43 genhtml --output-directory $(top_builddir)/lcov $(top_builddir)/lcov/aubio.info -
configure.ac
rb050e8e r70585a5 35 35 dnl Enable debugging (no) 36 36 AC_ARG_ENABLE(debug, 37 [ --enable-debug[[=value]] compile with debug [[default=no]]],37 AC_HELP_STRING([--enable-debug],[compile in debug mode [[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 [ --enable-warnings[[=value]] compile with all gcc warnings [[default=yes]]],48 AC_HELP_STRING([--enable-warnings],[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 warnings 69 70 AC_ARG_ENABLE(errorfail, 70 [ --enable-errorfail[[=value]] fail on compilation warnings [[default=no]]],71 AC_HELP_STRING([--enable-errorfail],[fail on compilation warnings [[default=no]]]), 71 72 AUBIO_CFLAGS="$AUBIO_CFLAGS -Werror -Wmissing-prototypes -Wmissing-declarations -Wno-unused-parameter", 72 with_warnme="no") 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") 73 80 74 81 dnl Check for libtool -
examples/aubioonset.c
rb050e8e r70585a5 72 72 if (isonset && output_filename == NULL) { 73 73 if(frames >= 4) { 74 outmsg("%f\n",(frames- 4)*overlap_size/(float)samplerate);75 } else if (frames < 4) {74 outmsg("%f\n",(frames-frames_delay)*overlap_size/(float)samplerate); 75 } else if (frames < frames_delay) { 76 76 outmsg("%f\n",0.); 77 77 } … … 80 80 81 81 int main(int argc, char **argv) { 82 frames_delay = 4; 82 83 examples_common_init(argc,argv); 83 84 examples_common_process(aubio_process,process_print); -
examples/utils.c
rb050e8e r70585a5 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); 24 25 pthread_t lash_thread; 25 26 #endif /* LASH_SUPPORT */ … … 33 34 int usejack = 0; 34 35 int usedoubled = 1; 36 int frames_delay = 0; 35 37 36 38 … … 395 397 396 398 debug("Processed %d frames of %d samples.\n", frames, buffer_size); 399 400 flush_process(process_func, print); 397 401 del_aubio_sndfile(file); 398 402 … … 403 407 } 404 408 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 } 405 421 406 422 -
examples/utils.h
rb050e8e r70585a5 42 42 extern int usejack; 43 43 extern int usedoubled; 44 extern int frames_delay; 44 45 extern unsigned int median; 45 46 extern const char * output_filename; -
src/fft.c
rb050e8e r70585a5 46 46 uint_t fft_size; 47 47 real_t *in, *out; 48 fftw_plan 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 HAVE_COMPLEX_H104 #ifdef 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 HAVE_COMPLEX_H123 #ifdef HAVE_COMPLEX_H 124 124 s->specdata[0] = compspec->data[i][0]; 125 125 for (j=1; j < s->fft_size - 1; j++) { -
src/onsetdetection.c
rb050e8e r70585a5 284 284 } 285 285 286 void aubio_onsetdetection_free (aubio_onsetdetection_t *o){287 del_aubio_onsetdetection(o);288 }289 290 286 void del_aubio_onsetdetection (aubio_onsetdetection_t *o){ 291 287 -
src/onsetdetection.h
rb050e8e r70585a5 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 170 163 171 164 #ifdef __cplusplus -
src/pitchyinfft.c
rb050e8e r70585a5 138 138 } 139 139 } else 140 return 0 ;140 return 0.; 141 141 } 142 142 -
swig/aubio.i
rb050e8e r70585a5 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);181 180 182 181 /* should these still be exposed ? */ -
tests/src/Makefile.am
rb050e8e r70585a5 7 7 bin_PROGRAMS = \ 8 8 test-fft \ 9 test-mfft \10 9 test-hist \ 11 10 test-scale \ -
tests/src/test-fft.c
rb050e8e r70585a5 1 #include <stdlib.h> 2 #include <math.h> 3 #include <complex.h> 1 4 2 #include <aubio.h> 5 3 6 #define NEW_ARRAY(_t,_n) (_t*)malloc((_n)*sizeof(_t))7 8 9 4 int main(){ 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 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"); 21 del_aubio_fft(fft); 47 22 del_fvec(in); 23 del_cvec(fftgrain); 48 24 del_fvec(out); 49 del_cvec(fftgrain); 50 free(w); 51 del_aubio_fft(fft); 52 for (i=0; i < channels; i++) 53 free(spec[i]); 54 free(spec); 25 //printf("memory freed\n"); 55 26 aubio_cleanup(); 56 27 return 0;
Note: See TracChangeset
for help on using the changeset viewer.