- Timestamp:
- Sep 8, 2007, 2:09:59 PM (17 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
- Children:
- f918cb9
- Parents:
- 21bd43c
- Location:
- src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/filterbank.h
r21bd43c r73eaa2e 1 1 /* 2 Copyright (C) 2007 Amaury Hazan 3 adapted to aubio from LibXtract 4 http://libxtract.sourceforge.net/ 5 2 Copyright (C) 2007 Amaury Hazan <ahazan@iua.upf.edu> 3 and Paul Brossier <piem@piem.org> 6 4 7 5 This program is free software; you can redistribute it and/or modify … … 28 26 */ 29 27 30 #ifndef AUBIOFILTERBANK_H31 #define AUBIOFILTERBANK_H28 #ifndef FILTERBANK_H 29 #define FILTERBANK_H 32 30 33 31 #ifdef __cplusplus 34 32 extern "C" { 35 33 #endif 36 37 38 34 39 35 typedef struct aubio_filterbank_t_ aubio_filterbank_t; … … 78 74 #endif 79 75 80 #endif 76 #endif // FILTERBANK_H -
src/mfcc.h
r21bd43c r73eaa2e 1 1 /* 2 Copyright (C) 2006 Amaury Hazan 3 Ported to aubio from LibXtract 4 http://libxtract.sourceforge.net/ 5 2 Copyright (C) 2007 Amaury Hazan <ahazan@iua.upf.edu> 3 and Paul Brossier <piem@piem.org> 6 4 7 5 This program is free software; you can redistribute it and/or modify … … 21 19 */ 22 20 21 /* part of this mfcc implementation were inspired from LibXtract 22 http://libxtract.sourceforge.net/ 23 */ 24 23 25 #ifndef MFCC_H 24 26 #define MFCC_H … … 30 32 #include "filterbank.h" 31 33 32 //libXtract constants and enums33 // TODO: remove them34 35 #define XTRACT_SQ(a) ((a) * (a))36 #define XTRACT_MIN(a, b) ((a) < (b) ? (a) : (b))37 #define XTRACT_MAX(a, b) ((a) > (b) ? (a) : (b))38 #define XTRACT_NEEDS_FFTW printf("LibXtract must be compiled with fftw support to use this function.\n")39 #define XTRACT_VERY_SMALL_NUMBER 2e-4240 #define XTRACT_LOG_LIMIT XTRACT_VERY_SMALL_NUMBER41 #define XTRACT_LOG_LIMIT_DB -96.042 #define XTRACT_DB_SCALE_OFFSET 96.043 #define XTRACT_VERY_BIG_NUMBER 2e4244 #define XTRACT_SR_UPPER_LIMIT 192000.045 #define XTRACT_SR_LOWER_LIMIT 22050.046 #define XTRACT_SR_DEFAULT 44100.047 #define XTRACT_FUNDAMENTAL_DEFAULT 440.048 #define XTRACT_CHECK_nyquist if(!nyquist) nyquist = XTRACT_SR_DEFAULT / 249 #define XTRACT_CHECK_q if(!q) q = XTRACT_SR_DEFAULT / N50 #define XTRACT_IS_ODD(x) (x % 2 != 0 ? 1 : 0)51 #define XTRACT_SR_LIMIT SR_UPPER_LIMIT52 #define XTRACT_FFT_BANDS_MIN 1653 #define XTRACT_FFT_BANDS_MAX 6553654 #define XTRACT_FFT_BANDS_DEF 102455 #define XTRACT_SPEC_BW_MIN 0.168 /* Minimum spectral bandwidth \56 (= SR_LOWER_LIMIT / FFT_BANDS_MAX*/57 #define XTRACT_SPEC_BW_MAX 12000.0 /* SR_UPPER_LIMIT / FFT_BANDS_MIN */58 #define XTRACT_SPEC_BW_DEF 43.066 /* SR_DEFAULT / FFT_BANDS_DEF */59 60 /** \brief Enumeration of feature initialisation functions */61 enum xtract_feature_init_ {62 XTRACT_INIT_MFCC = 100,63 XTRACT_INIT_BARK64 };65 66 /** \brief Enumeration of feature types */67 enum xtract_feature_types_ {68 XTRACT_SCALAR,69 XTRACT_VECTOR,70 XTRACT_DELTA71 };72 73 /** \brief Enumeration of mfcc types */74 enum xtract_mfcc_types_ {75 XTRACT_EQUAL_GAIN,76 XTRACT_EQUAL_AREA77 };78 79 /** \brief Enumeration of return codes */80 enum xtract_return_codes_ {81 XTRACT_SUCCESS,82 XTRACT_MALLOC_FAILED,83 XTRACT_BAD_ARGV,84 XTRACT_BAD_VECTOR_SIZE,85 XTRACT_NO_RESULT,86 XTRACT_FEATURE_NOT_IMPLEMENTED87 };88 89 /** \brief Enumeration of spectrum types */90 enum xtract_spectrum_ {91 XTRACT_MAGNITUDE_SPECTRUM,92 XTRACT_LOG_MAGNITUDE_SPECTRUM,93 XTRACT_POWER_SPECTRUM,94 XTRACT_LOG_POWER_SPECTRUM95 };96 97 /** \brief Enumeration of data types*/98 typedef enum type_ {99 XTRACT_FLOAT,100 XTRACT_FLOATARRAY,101 XTRACT_INT,102 XTRACT_MEL_FILTER103 } xtract_type_t;104 105 /** \brief Enumeration of units*/106 typedef enum unit_ {107 /* NONE, ANY */108 XTRACT_HERTZ = 2,109 XTRACT_ANY_AMPLITUDE_HERTZ,110 XTRACT_DBFS,111 XTRACT_DBFS_HERTZ,112 XTRACT_PERCENT,113 XTRACT_SONE114 } xtract_unit_t;115 116 /** \brief Boolean */117 typedef enum {118 XTRACT_FALSE,119 XTRACT_TRUE120 } xtract_bool_t;121 122 /** \brief Enumeration of vector format types*/123 typedef enum xtract_vector_ {124 /* N/2 magnitude/log-magnitude/power/log-power coeffs and N/2 frequencies */125 XTRACT_SPECTRAL,126 /* N spectral amplitudes */127 XTRACT_SPECTRAL_MAGNITUDES,128 /* N/2 magnitude/log-magnitude/power/log-power peak coeffs and N/2129 * frequencies */130 XTRACT_SPECTRAL_PEAKS,131 /* N spectral peak amplitudes */132 XTRACT_SPECTRAL_PEAKS_MAGNITUDES,133 /* N spectral peak frequencies */134 XTRACT_SPECTRAL_PEAKS_FREQUENCIES,135 /* N/2 magnitude/log-magnitude/power/log-power harmonic peak coeffs and N/2136 * frequencies */137 XTRACT_SPECTRAL_HARMONICS,138 /* N spectral harmonic amplitudes */139 XTRACT_SPECTRAL_HARMONICS_MAGNITUDES,140 /* N spectral harmonic frequencies */141 XTRACT_SPECTRAL_HARMONICS_FREQUENCIES,142 XTRACT_ARBITRARY_SERIES,143 XTRACT_AUDIO_SAMPLES,144 XTRACT_MEL_COEFFS,145 XTRACT_BARK_COEFFS,146 XTRACT_NO_DATA147 } xtract_vector_t;148 149 150 34 typedef struct aubio_mfcc_t_ aubio_mfcc_t; 151 152 // Creation153 35 154 36 /** create mfcc object … … 163 45 */ 164 46 aubio_mfcc_t * new_aubio_mfcc (uint_t win_s, uint_t samplerate ,uint_t n_coefs, smpl_t lowfreq, smpl_t highfreq, uint_t channels); 165 166 // Deletion167 168 47 /** delete mfcc object 169 48 … … 172 51 */ 173 52 void del_aubio_mfcc(aubio_mfcc_t *mf); 174 175 // Process176 177 53 /** mfcc object processing 178 54 … … 182 58 183 59 */ 184 185 60 void aubio_mfcc_do(aubio_mfcc_t * mf, cvec_t *in, fvec_t *out); 186 61 … … 192 67 193 68 */ 194 195 69 void aubio_dct_do(aubio_mfcc_t * mf, fvec_t *in, fvec_t *out); 196 197 198 199 200 //old code201 202 203 /*204 int aubio_mfcc_do(const float *data, const int N, const void *argv, float *result, aubio_mfft_t *fft_dct, cvec_t *fftgrain_dct);205 206 int aubio_dct_do(const float *data, const int N, const void *argv, float *result, aubio_mfft_t *fft_dct, cvec_t *fftgrain_dct);*/207 208 209 210 70 211 71 #ifdef __cplusplus … … 213 73 #endif 214 74 215 #endif 75 #endif // MFCC_H
Note: See TracChangeset
for help on using the changeset viewer.