Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/mathutils.c

    rade9afe r6c7d49b  
    2121
    2222#include "aubio_priv.h"
    23 #include "sample.h"
     23#include "fvec.h"
    2424#include "mathutils.h"
    2525#include "config.h"
     
    227227  /* pre part of the buffer does not exist */
    228228  } else {
    229     for (k=0;k<length-pos+post+1;k++)
     229    for (k=0;k<length-pos+post;k++)
    230230      medar[k] = vec->data[0][k+pos-post];
    231     for (k=length-pos+post+1;k<win_length;k++)
     231    for (k=length-pos+post;k<win_length;k++)
    232232      medar[k] = 0.; /* 0-padding at the end */
    233233  }
     
    433433}
    434434
    435 smpl_t aubio_spectral_centroid(cvec_t * spectrum, smpl_t samplerate) {
    436   uint_t i=0, j;
    437   smpl_t sum = 0., sc = 0.;
    438   for ( j = 0; j < spectrum->length; j++ ) {
    439     sum += spectrum->norm[i][j];
    440   }
    441   if (sum == 0.) return 0.;
    442   for ( j = 0; j < spectrum->length; j++ ) {
    443     sc += (smpl_t)j * spectrum->norm[i][j];
    444   }
    445   return sc / sum * samplerate / (smpl_t)(spectrum->length);
    446 }
    447 
    448435void aubio_autocorr(fvec_t * input, fvec_t * output) {
    449436  uint_t i = 0, j = 0, length = input->length;
Note: See TracChangeset for help on using the changeset viewer.