Changes in / [70585a5:b050e8e]


Ignore:
Files:
1 added
13 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified .bzrignore

    r70585a5 rb050e8e  
    55**/*.lo
    66**/*.la
    7 
    8 # gcov generated files
    9 **/*.gcno
    10 **/*.gcda
    117
    128# ignore compiled examples
     
    3834configure
    3935depcomp
    40 mkinstalldirs
    4136install-sh
    4237libtool
  • TabularUnified Makefile.am

    r70585a5 rb050e8e  
    3636uninstall-hook: uninstall-pkgconfig
    3737
    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
  • TabularUnified configure.ac

    r70585a5 rb050e8e  
    3535dnl Enable debugging (no)
    3636AC_ARG_ENABLE(debug,
    37   AC_HELP_STRING([--enable-debug],[compile in debug mode [[default=no]]]),
     37  [  --enable-debug[[=value]]  compile with debug [[default=no]]],
    3838  with_debug="yes",
    3939  with_debug="no")
     
    4646dnl Enable full warnings (yes)
    4747AC_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]]],
    4949  with_warnme="no",
    5050  with_warnme="yes")
     
    6767fi
    6868
    69 dnl fail on compilation warnings
    7069AC_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]]],
    7271  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")
    8073
    8174dnl Check for libtool
  • TabularUnified examples/aubioonset.c

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

    r70585a5 rb050e8e  
    2222void save_data (void);
    2323void restore_data(lash_config_t * lash_config);
    24 void flush_process(aubio_process_func_t process_func, aubio_print_func_t print);
    2524pthread_t lash_thread;
    2625#endif /* LASH_SUPPORT */
     
    3433int usejack = 0;
    3534int usedoubled = 1;
    36 int frames_delay = 0;
    3735
    3836
     
    397395
    398396    debug("Processed %d frames of %d samples.\n", frames, buffer_size);
    399 
    400     flush_process(process_func, print);
    401397    del_aubio_sndfile(file);
    402398
     
    407403}
    408404
    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 }
    421405
    422406
  • TabularUnified examples/utils.h

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

    r70585a5 rb050e8e  
    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 #ifdef HAVE_COMPLEX_H
     104#if 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 #ifdef HAVE_COMPLEX_H
     123#if HAVE_COMPLEX_H
    124124    s->specdata[0] = compspec->data[i][0];
    125125    for (j=1; j < s->fft_size - 1; j++) {
  • TabularUnified src/onsetdetection.c

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

    r70585a5 rb050e8e  
    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*/
     168void aubio_onsetdetection_free(aubio_onsetdetection_t *o);
     169
    163170
    164171#ifdef __cplusplus
  • TabularUnified src/pitchyinfft.c

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

    r70585a5 rb050e8e  
    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);
     180void aubio_onsetdetection_free(aubio_onsetdetection_t *o);
    180181
    181182/* should these still be exposed ? */
  • TabularUnified tests/src/Makefile.am

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

    r70585a5 rb050e8e  
    1 
     1#include <stdlib.h>
     2#include <math.h>
     3#include <complex.h>
    24#include <aubio.h>
    35
     6#define NEW_ARRAY(_t,_n)                (_t*)malloc((_n)*sizeof(_t))
     7
     8
    49int 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);
    2151        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);
    2655        aubio_cleanup();
    2756        return 0;
Note: See TracChangeset for help on using the changeset viewer.