Changeset 1651b58


Ignore:
Timestamp:
Nov 4, 2009, 10:24:06 PM (10 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:
7893149
Parents:
95d3f16
Message:

src/spectral/: added statistics.c, containing some cuidado spectral shape descriptors

Location:
src
Files:
1 added
2 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • src/Makefile.am

    r95d3f16 r1651b58  
    2424        spectral/tss.h \
    2525        spectral/specdesc.h \
    26         spectral/spectral_centroid.h \
    2726        pitch/pitch.h \
    2827        pitch/pitchmcomb.h \
     
    5857        spectral/fft.c \
    5958        spectral/tss.c \
    60         spectral/spectral_centroid.c \
     59        spectral/specdesc.c \
     60        spectral/statistics.c \
    6161        pitch/pitch.c \
    6262        pitch/pitchmcomb.c \
     
    6666        pitch/pitchyinfft.c \
    6767        onset/onset.c \
    68         onset/onsetdetection.c \
    6968        onset/peakpick.c \
    7069        tempo/tempo.c \
  • src/aubio.h

    r95d3f16 r1651b58  
    184184#include "pitch/pitchschmitt.h"
    185185#include "pitch/pitchfcomb.h"
    186 #include "spectral/spectral_centroid.h"
    187186#include "onset/peakpick.h"
    188187#include "tempo/beattracking.h"
  • src/spectral/specdesc.c

    r95d3f16 r1651b58  
    2727#include "utils/hist.h"
    2828
    29 /** Energy based onset detection function
    30  
    31   This function calculates the local energy of the input spectral frame.
    32  
    33   \param o onset detection object as returned by new_aubio_specdesc()
    34   \param fftgrain input spectral frame
    35   \param onset output onset detection function
    36 
    37 */
    3829void aubio_specdesc_energy(aubio_specdesc_t *o, cvec_t * fftgrain, fvec_t * onset);
    39 /** High Frequency Content onset detection function
    40  
    41   This method computes the High Frequency Content (HFC) of the input spectral
    42   frame. The resulting function is efficient at detecting percussive onsets.
    43 
    44   Paul Masri. Computer modeling of Sound for Transformation and Synthesis of
    45   Musical Signal. PhD dissertation, University of Bristol, UK, 1996.
    46  
    47   \param o onset detection object as returned by new_aubio_specdesc()
    48   \param fftgrain input spectral frame
    49   \param onset output onset detection function
    50 
    51 */
    5230void aubio_specdesc_hfc(aubio_specdesc_t *o, cvec_t * fftgrain, fvec_t * onset);
    53 /** Complex Domain Method onset detection function
    54  
    55   Christopher Duxbury, Mike E. Davies, and Mark B. Sandler. Complex domain
    56   onset detection for musical signals. In Proceedings of the Digital Audio
    57   Effects Conference, DAFx-03, pages 90-93, London, UK, 2003.
    58 
    59   \param o onset detection object as returned by new_aubio_specdesc()
    60   \param fftgrain input spectral frame
    61   \param onset output onset detection function
    62 
    63 */
    6431void aubio_specdesc_complex(aubio_specdesc_t *o, cvec_t * fftgrain, fvec_t * onset);
    65 /** Phase Based Method onset detection function
    66 
    67   Juan-Pablo Bello, Mike P. Davies, and Mark B. Sandler. Phase-based note onset
    68   detection for music signals. In Proceedings of the IEEE International
    69   Conference on Acoustics Speech and Signal Processing, pages 441­444,
    70   Hong-Kong, 2003.
    71 
    72   \param o onset detection object as returned by new_aubio_specdesc()
    73   \param fftgrain input spectral frame
    74   \param onset output onset detection function
    75 
    76 */
    7732void aubio_specdesc_phase(aubio_specdesc_t *o, cvec_t * fftgrain, fvec_t * onset);
    78 /** Spectral difference method onset detection function
    79 
    80   Jonhatan Foote and Shingo Uchihashi. The beat spectrum: a new approach to
    81   rhythm analysis. In IEEE International Conference on Multimedia and Expo
    82   (ICME 2001), pages 881­884, Tokyo, Japan, August 2001.
    83 
    84   \param o onset detection object as returned by new_aubio_specdesc()
    85   \param fftgrain input spectral frame
    86   \param onset output onset detection function
    87 
    88 */
    8933void aubio_specdesc_specdiff(aubio_specdesc_t *o, cvec_t * fftgrain, fvec_t * onset);
    90 /** Kullback-Liebler onset detection function
    91  
    92   Stephen Hainsworth and Malcom Macleod. Onset detection in music audio
    93   signals. In Proceedings of the International Computer Music Conference
    94   (ICMC), Singapore, 2003.
    95  
    96   \param o onset detection object as returned by new_aubio_specdesc()
    97   \param fftgrain input spectral frame
    98   \param onset output onset detection function
    99 
    100 */
    10134void aubio_specdesc_kl(aubio_specdesc_t *o, cvec_t * fftgrain, fvec_t * onset);
    102 /** Modified Kullback-Liebler onset detection function
    103 
    104   Paul Brossier, ``Automatic annotation of musical audio for interactive
    105   systems'', Chapter 2, Temporal segmentation, PhD thesis, Centre for Digital
    106   music, Queen Mary University of London, London, UK, 2006.
    107 
    108   \param o onset detection object as returned by new_aubio_specdesc()
    109   \param fftgrain input spectral frame
    110   \param onset output onset detection function
    111 
    112 */
    11335void aubio_specdesc_mkl(aubio_specdesc_t *o, cvec_t * fftgrain, fvec_t * onset);
    114 /** Spectral Flux
    115 
    116   Simon Dixon, Onset Detection Revisited, in ``Proceedings of the 9th
    117   International Conference on Digital Audio Effects'' (DAFx-06), Montreal,
    118   Canada, 2006.
    119 
    120   \param o onset detection object as returned by new_aubio_specdesc()
    121   \param fftgrain input spectral frame
    122   \param onset output onset detection function
    123 
    124 */
    12536void aubio_specdesc_specflux(aubio_specdesc_t *o, cvec_t * fftgrain, fvec_t * onset);
     37
     38extern void aubio_specdesc_centroid (aubio_specdesc_t * o, cvec_t * spec,
     39    fvec_t * desc);
     40extern void aubio_specdesc_spread (aubio_specdesc_t * o, cvec_t * spec,
     41    fvec_t * desc);
     42extern void aubio_specdesc_skewness (aubio_specdesc_t * o, cvec_t * spec,
     43    fvec_t * desc);
     44extern void aubio_specdesc_kurtosis (aubio_specdesc_t * o, cvec_t * spec,
     45    fvec_t * desc);
     46extern void aubio_specdesc_slope (aubio_specdesc_t * o, cvec_t * spec,
     47    fvec_t * desc);
     48extern void aubio_specdesc_decrease (aubio_specdesc_t * o, cvec_t * spec,
     49    fvec_t * desc);
     50extern void aubio_specdesc_rolloff (aubio_specdesc_t * o, cvec_t * spec,
     51    fvec_t * desc);
    12652
    12753/** onsetdetection types */
     
    13561        aubio_onset_mkl,            /**< modified Kullback Liebler */
    13662        aubio_onset_specflux,       /**< spectral flux */
     63        aubio_specmethod_centroid,  /**< spectral centroid */
     64        aubio_specmethod_spread,    /**< spectral spread */
     65        aubio_specmethod_skewness,  /**< spectral skewness */
     66        aubio_specmethod_kurtosis,  /**< spectral kurtosis */
     67        aubio_specmethod_slope,     /**< spectral kurtosis */
     68        aubio_specmethod_decrease,  /**< spectral decrease */
     69        aubio_specmethod_rolloff,   /**< spectral rolloff */
    13770        aubio_onset_default = aubio_onset_hfc, /**< default mode, set to hfc */
    13871} aubio_specdesc_type;
     
    342275  else if (strcmp (onset_mode, "specflux") == 0)
    343276      onset_type = aubio_onset_specflux;
     277  else if (strcmp (onset_mode, "centroid") == 0)
     278      onset_type = aubio_specmethod_centroid;
     279  else if (strcmp (onset_mode, "spread") == 0)
     280      onset_type = aubio_specmethod_spread;
     281  else if (strcmp (onset_mode, "skewness") == 0)
     282      onset_type = aubio_specmethod_skewness;
     283  else if (strcmp (onset_mode, "kurtosis") == 0)
     284      onset_type = aubio_specmethod_kurtosis;
     285  else if (strcmp (onset_mode, "slope") == 0)
     286      onset_type = aubio_specmethod_slope;
     287  else if (strcmp (onset_mode, "decrease") == 0)
     288      onset_type = aubio_specmethod_decrease;
     289  else if (strcmp (onset_mode, "rolloff") == 0)
     290      onset_type = aubio_specmethod_rolloff;
    344291  else if (strcmp (onset_mode, "default") == 0)
    345292      onset_type = aubio_onset_default;
    346293  else {
    347       AUBIO_ERR("unknown onset type.\n");
     294      AUBIO_ERR("unknown spectral descriptor type %s.\n", onset_mode);
    348295      onset_type = aubio_onset_default;
    349296  }
     
    412359      o->funcpointer = aubio_specdesc_specflux;
    413360      break;
     361    // for for the additional descriptors. these don't need additional memory
     362    case aubio_specmethod_centroid:
     363      o->funcpointer = aubio_specdesc_centroid;
     364      break;
     365    case aubio_specmethod_spread:
     366      o->funcpointer = aubio_specdesc_spread;
     367      break;
     368    case aubio_specmethod_skewness:
     369      o->funcpointer = aubio_specdesc_skewness;
     370      break;
     371    case aubio_specmethod_kurtosis:
     372      o->funcpointer = aubio_specdesc_kurtosis;
     373      break;
     374    case aubio_specmethod_slope:
     375      o->funcpointer = aubio_specdesc_slope;
     376      break;
     377    case aubio_specmethod_decrease:
     378      o->funcpointer = aubio_specdesc_decrease;
     379      break;
     380    case aubio_specmethod_rolloff:
     381      o->funcpointer = aubio_specdesc_rolloff;
     382      break;
    414383    default:
    415384      break;
Note: See TracChangeset for help on using the changeset viewer.