Changeset fc6c831


Ignore:
Timestamp:
Nov 24, 2007, 10:47:15 PM (13 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:
6c7d49b
Parents:
e2da295
Message:

moved spectral_centroid to new file

Location:
src
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • src/Makefile.am

    re2da295 rfc6c831  
    1515        spectral/fft.h \
    1616        spectral/tss.h \
     17        spectral/spectral_centroid.h \
    1718        pitch/pitchdetection.h \
    1819        pitch/pitchmcomb.h \
     
    5859        spectral/tss.c \
    5960        spectral/tss.h \
     61        spectral/spectral_centroid.c \
     62        spectral/spectral_centroid.h \
    6063        pitch/pitchdetection.c \
    6164        pitch/pitchdetection.h \
  • src/aubio.h

    re2da295 rfc6c831  
    6060#include "types.h"
    6161#include "sample.h"
    62 #include "spectral/fft.h"
    63 #include "spectral/phasevoc.h"
    6462#include "mathutils.h"
    6563#include "utils/scale.h"
     
    6967#include "temporal/biquad.h"
    7068#include "temporal/filter.h"
     69#include "spectral/filterbank.h"
     70#include "spectral/mfcc.h"
     71#include "spectral/fft.h"
     72#include "spectral/phasevoc.h"
     73#include "spectral/spectral_centroid.h"
    7174#include "pitch/pitchdetection.h"
    7275#include "pitch/pitchmcomb.h"
     
    8083#include "tempo/beattracking.h"
    8184#include "tempo/tempo.h"
    82 #include "spectral/filterbank.h"
    83 #include "spectral/mfcc.h"
    8485
    8586#ifdef __cplusplus
  • src/mathutils.c

    re2da295 rfc6c831  
    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;
  • src/mathutils.h

    re2da295 rfc6c831  
    209209smpl_t aubio_zero_crossing_rate(fvec_t * input);
    210210/**
    211  * spectrum centroid computed on a cvec
    212  */
    213 smpl_t aubio_spectral_centroid(cvec_t * input, smpl_t samplerate);
    214 /**
    215211 * clean up cached memory at the end of program
    216212 *
Note: See TracChangeset for help on using the changeset viewer.