Changeset 73eaa2e


Ignore:
Timestamp:
Sep 8, 2007, 2:09:59 PM (17 years ago)
Author:
Paul Brossier <piem@piem.org>
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
Message:

update copyrights, remove old libxtract code, cosmetic header changes

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/filterbank.h

    r21bd43c r73eaa2e  
    11/*
    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>
    64
    75   This program is free software; you can redistribute it and/or modify
     
    2826*/
    2927
    30 #ifndef AUBIOFILTERBANK_H
    31 #define AUBIOFILTERBANK_H
     28#ifndef FILTERBANK_H
     29#define FILTERBANK_H
    3230
    3331#ifdef __cplusplus
    3432extern "C" {
    3533#endif
    36 
    37 
    3834
    3935typedef struct aubio_filterbank_t_ aubio_filterbank_t;
     
    7874#endif
    7975
    80 #endif
     76#endif // FILTERBANK_H
  • src/mfcc.h

    r21bd43c r73eaa2e  
    11/*
    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>
    64
    75   This program is free software; you can redistribute it and/or modify
     
    2119*/
    2220
     21/* part of this mfcc implementation were inspired from LibXtract
     22   http://libxtract.sourceforge.net/
     23*/
     24
    2325#ifndef MFCC_H
    2426#define MFCC_H
     
    3032#include "filterbank.h"
    3133
    32 //libXtract constants and enums
    33 // TODO: remove them
    34 
    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-42
    40 #define XTRACT_LOG_LIMIT XTRACT_VERY_SMALL_NUMBER
    41 #define XTRACT_LOG_LIMIT_DB -96.0
    42 #define XTRACT_DB_SCALE_OFFSET 96.0
    43 #define XTRACT_VERY_BIG_NUMBER 2e42
    44 #define XTRACT_SR_UPPER_LIMIT 192000.0
    45 #define XTRACT_SR_LOWER_LIMIT 22050.0
    46 #define XTRACT_SR_DEFAULT 44100.0
    47 #define XTRACT_FUNDAMENTAL_DEFAULT 440.0
    48 #define XTRACT_CHECK_nyquist if(!nyquist) nyquist = XTRACT_SR_DEFAULT / 2
    49 #define XTRACT_CHECK_q if(!q) q = XTRACT_SR_DEFAULT / N
    50 #define XTRACT_IS_ODD(x) (x % 2 != 0 ? 1 : 0)
    51 #define XTRACT_SR_LIMIT SR_UPPER_LIMIT
    52 #define XTRACT_FFT_BANDS_MIN 16
    53 #define XTRACT_FFT_BANDS_MAX 65536
    54 #define XTRACT_FFT_BANDS_DEF 1024
    55 #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_BARK
    64 };
    65 
    66 /** \brief Enumeration of feature types */
    67 enum xtract_feature_types_ {
    68     XTRACT_SCALAR,
    69     XTRACT_VECTOR,
    70     XTRACT_DELTA
    71 };
    72 
    73 /** \brief Enumeration of mfcc types */
    74 enum xtract_mfcc_types_ {
    75     XTRACT_EQUAL_GAIN,
    76     XTRACT_EQUAL_AREA
    77 };
    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_IMPLEMENTED
    87 };
    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_SPECTRUM
    95 };
    96 
    97 /** \brief Enumeration of data types*/
    98 typedef enum type_ {
    99     XTRACT_FLOAT,
    100     XTRACT_FLOATARRAY,
    101     XTRACT_INT,
    102     XTRACT_MEL_FILTER
    103 } 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_SONE
    114 } xtract_unit_t;
    115 
    116 /** \brief Boolean */
    117 typedef enum {
    118     XTRACT_FALSE,
    119     XTRACT_TRUE
    120 } 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/2
    129      * 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/2
    136      * 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_DATA
    147 } xtract_vector_t;
    148 
    149 
    15034typedef struct aubio_mfcc_t_ aubio_mfcc_t;
    151 
    152 // Creation
    15335
    15436/** create mfcc object
     
    16345*/
    16446aubio_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 // Deletion
    167 
    16847/** delete mfcc object
    16948
     
    17251*/
    17352void del_aubio_mfcc(aubio_mfcc_t *mf);
    174 
    175 // Process
    176 
    17753/** mfcc object processing
    17854
     
    18258
    18359*/
    184 
    18560void aubio_mfcc_do(aubio_mfcc_t * mf, cvec_t *in, fvec_t *out);
    18661
     
    19267
    19368*/
    194 
    19569void aubio_dct_do(aubio_mfcc_t * mf, fvec_t *in, fvec_t *out);
    196 
    197 
    198 
    199 
    200 //old code
    201 
    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 
    21070
    21171#ifdef __cplusplus
     
    21373#endif
    21474
    215 #endif
     75#endif // MFCC_H
Note: See TracChangeset for help on using the changeset viewer.