Changeset 70585a5


Ignore:
Timestamp:
Nov 21, 2007, 4:53:13 PM (12 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, 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.
Message:

merge from main branch

Files:
1 deleted
13 edited

Legend:

Unmodified
Added
Removed
  • .bzrignore

    rb050e8e r70585a5  
    55**/*.lo
    66**/*.la
     7
     8# gcov generated files
     9**/*.gcno
     10**/*.gcda
    711
    812# ignore compiled examples
     
    3438configure
    3539depcomp
     40mkinstalldirs
    3641install-sh
    3742libtool
  • Makefile.am

    rb050e8e r70585a5  
    3636uninstall-hook: uninstall-pkgconfig
    3737
     38lcov: 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  
    3535dnl Enable debugging (no)
    3636AC_ARG_ENABLE(debug,
    37   [  --enable-debug[[=value]]  compile with debug [[default=no]]],
     37  AC_HELP_STRING([--enable-debug],[compile in debug mode [[default=no]]]),
    3838  with_debug="yes",
    3939  with_debug="no")
     
    4646dnl Enable full warnings (yes)
    4747AC_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]]]),
    4949  with_warnme="no",
    5050  with_warnme="yes")
     
    6767fi
    6868
     69dnl fail on compilation warnings
    6970AC_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]]]),
    7172  AUBIO_CFLAGS="$AUBIO_CFLAGS -Werror -Wmissing-prototypes -Wmissing-declarations -Wno-unused-parameter",
    72   with_warnme="no")
     73  with_errorfail="no")
     74
     75dnl add gcov/lcov profiling and coverage flags
     76AC_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")
    7380
    7481dnl Check for libtool
  • examples/aubioonset.c

    rb050e8e r70585a5  
    7272      if (isonset && output_filename == NULL) {
    7373        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) {
    7676          outmsg("%f\n",0.);
    7777        }
     
    8080
    8181int main(int argc, char **argv) {
     82  frames_delay = 4;
    8283  examples_common_init(argc,argv);
    8384  examples_common_process(aubio_process,process_print);
  • examples/utils.c

    rb050e8e r70585a5  
    2222void save_data (void);
    2323void restore_data(lash_config_t * lash_config);
     24void flush_process(aubio_process_func_t process_func, aubio_print_func_t print);
    2425pthread_t lash_thread;
    2526#endif /* LASH_SUPPORT */
     
    3334int usejack = 0;
    3435int usedoubled = 1;
     36int frames_delay = 0;
    3537
    3638
     
    395397
    396398    debug("Processed %d frames of %d samples.\n", frames, buffer_size);
     399
     400    flush_process(process_func, print);
    397401    del_aubio_sndfile(file);
    398402
     
    403407}
    404408
     409void 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}
    405421
    406422
  • examples/utils.h

    rb050e8e r70585a5  
    4242extern int usejack;
    4343extern int usedoubled;
     44extern int frames_delay;
    4445extern unsigned int median;
    4546extern const char * output_filename;
  • src/fft.c

    rb050e8e r70585a5  
    4646  uint_t fft_size;
    4747  real_t *in, *out;
    48   fftw_plan   pfw, pbw;
     48  fftw_plan pfw, pbw;
    4949  fft_data_t * specdata;     /* complex spectral data */
    5050  fvec_t * compspec;
     
    6161  /* create plans */
    6262#ifdef HAVE_COMPLEX_H
    63   s->fft_size = winsize/2+1;
     63  s->fft_size = winsize/2 + 1;
    6464  s->specdata = (fft_data_t*)fftw_malloc(sizeof(fft_data_t)*s->fft_size);
    6565  s->pfw = fftw_plan_dft_r2c_1d(winsize, s->in,  s->specdata, FFTW_ESTIMATE);
     
    102102    }
    103103    fftw_execute(s->pfw);
    104 #if HAVE_COMPLEX_H
     104#ifdef HAVE_COMPLEX_H
    105105    compspec->data[i][0] = REAL(s->specdata[0]);
    106106    for (j = 1; j < s->fft_size -1 ; j++) {
     
    121121  const smpl_t renorm = 1./(smpl_t)s->winsize;
    122122  for (i = 0; i < compspec->channels; i++) {
    123 #if HAVE_COMPLEX_H
     123#ifdef HAVE_COMPLEX_H
    124124    s->specdata[0] = compspec->data[i][0];
    125125    for (j=1; j < s->fft_size - 1; j++) {
  • src/onsetdetection.c

    rb050e8e r70585a5  
    284284}
    285285
    286 void aubio_onsetdetection_free (aubio_onsetdetection_t *o){
    287   del_aubio_onsetdetection(o);
    288 }
    289 
    290286void del_aubio_onsetdetection (aubio_onsetdetection_t *o){
    291287
  • src/onsetdetection.h

    rb050e8e r70585a5  
    161161*/
    162162void 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 
    170163
    171164#ifdef __cplusplus
  • src/pitchyinfft.c

    rb050e8e r70585a5  
    138138    }
    139139  } else
    140     return 0;
     140    return 0.;
    141141}
    142142
  • swig/aubio.i

    rb050e8e r70585a5  
    178178aubio_onsetdetection_t * new_aubio_onsetdetection(aubio_onsetdetection_type type, uint_t size, uint_t channels);
    179179void aubio_onsetdetection(aubio_onsetdetection_t *o, cvec_t * fftgrain, fvec_t * onset);
    180 void aubio_onsetdetection_free(aubio_onsetdetection_t *o);
    181180
    182181/* should these still be exposed ? */
  • tests/src/Makefile.am

    rb050e8e r70585a5  
    77bin_PROGRAMS = \
    88        test-fft \
    9         test-mfft \
    109        test-hist \
    1110        test-scale \
  • tests/src/test-fft.c

    rb050e8e r70585a5  
    1 #include <stdlib.h>
    2 #include <math.h>
    3 #include <complex.h>
     1
    42#include <aubio.h>
    53
    6 #define NEW_ARRAY(_t,_n)                (_t*)malloc((_n)*sizeof(_t))
    7 
    8 
    94int 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);
    4722        del_fvec(in);
     23        del_cvec(fftgrain);
    4824        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");
    5526        aubio_cleanup();
    5627        return 0;
Note: See TracChangeset for help on using the changeset viewer.