Changeset 71b1b4b for src


Ignore:
Timestamp:
Sep 6, 2007, 3:52:19 PM (17 years ago)
Author:
Amaury Hazan <mahmoudax@gmail.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:
7c6c806d
Parents:
dcc649c (diff), 97886fa (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merged from laptop

Location:
src
Files:
4 edited
2 moved

Legend:

Unmodified
Added
Removed
  • src/Makefile.am

    rdcc649c r71b1b4b  
    2222        onset.h \
    2323        tempo.h \
    24         filter.h
     24        filter.h
     25
    2526nodist_pkginclude_HEADERS = config.h
    2627
     
    6970        tempo.h \
    7071        filter.c \
    71         filter.h
     72        filter.h \
    7273
    7374AM_CFLAGS = @AUBIO_CFLAGS@ @FFTWLIB_CFLAGS@ @SAMPLERATE_CFLAGS@
  • src/aubio.h

    rdcc649c r71b1b4b  
    8080#include "onset.h"
    8181#include "tempo.h"
     82#include "mfcc.h"
    8283
    8384#ifdef __cplusplus
  • src/filterbank.c

    rdcc649c r71b1b4b  
    2121*/
    2222
    23 #include "aubiofilterbank.h"
     23#include "filterbank.h"
    2424
    2525// Initialization
    2626
    27 int aubio_mfcc_init(int N, float nyquist, int style, float freq_min, float freq_max, int freq_bands, float **fft_tables){
     27int aubio_mfcc_init(int N, smpl_t nyquist, int style, smpl_t freq_min, smpl_t freq_max, int freq_bands, smpl_t **fft_tables){
    2828
    2929    int n, i, k, *fft_peak, M, next_peak;
    30     float norm, mel_freq_max, mel_freq_min, norm_fact, height, inc, val,
     30    smpl_t norm, mel_freq_max, mel_freq_min, norm_fact, height, inc, val,
    3131        freq_bw_mel, *mel_peak, *height_norm, *lin_peak;
    3232
     
    3939    freq_bw_mel = (mel_freq_max - mel_freq_min) / freq_bands;
    4040
    41     mel_peak = (float *)malloc((freq_bands + 2) * sizeof(float));
     41    mel_peak = (smpl_t *)malloc((freq_bands + 2) * sizeof(smpl_t));
    4242    /* +2 for zeros at start and end */
    43     lin_peak = (float *)malloc((freq_bands + 2) * sizeof(float));
     43    lin_peak = (smpl_t *)malloc((freq_bands + 2) * sizeof(smpl_t));
    4444    fft_peak = (int *)malloc((freq_bands + 2) * sizeof(int));
    45     height_norm = (float *)malloc(freq_bands * sizeof(float));
     45    height_norm = (smpl_t *)malloc(freq_bands * sizeof(smpl_t));
    4646
    4747    if(mel_peak == NULL || height_norm == NULL ||
  • src/filterbank.h

    rdcc649c r71b1b4b  
    1818   along with this program; if not, write to the Free Software
    1919   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    20 
    2120*/
    2221
    2322#ifndef AUBIOFILTERBANK_H
    24 #include AUBIOFILTERBANK_H
     23#define AUBIOFILTERBANK_H
    2524
    26 #define NYQUIST 22050.f
    2725
    2826// Struct Declaration
     
    3129typedef struct aubio_mel_filter_ {
    3230    int n_filters;
    33     float **filters;
     31    smpl_t **filters;
    3432} aubio_mel_filter;
    3533
     
    4038 * It is up to the caller to pass in a pointer to memory allocated for freq_bands arrays of length N. This function populates these arrays with magnitude coefficients representing the mel filterbank on a linear scale
    4139 */
    42 int aubio_mfcc_init(int N, float nyquist, int style, float freq_min, float freq_max, int freq_bands, float **fft_tables);
     40int aubio_mfcc_init(int N, float nyquist, int style, float freq_min, float freq_max, int freq_bands, smpl_t ** fft_tables);
    4341
    4442#endif
  • src/mfcc.c

    rdcc649c r71b1b4b  
    2323
    2424#include "mffc.h"
    25 #include "aubiofilterbank.h"
    2625
    2726// Computation
     
    4241    }
    4342
     43    //TODO: check that zero padding
    4444    for(n = filter + 1; n < N; n++) result[n] = 0;
    4545   
     
    5151int aubio_dct_do(const float *data, const int N, const void *argv, float *result){
    5252   
     53   
     54    //call aubio p_voc in dct setting
     55
     56    //TODO: fvec as input? Remove data length, N?
     57
     58    //compute mag spectrum
     59    aubio_pvoc_do (pv,data, fftgrain);
     60
     61    int i;
     62    //extract real part of fft grain
     63    for(i=0; i<N ;i++){
     64      result[i]= fftgrain->norm[i]*cos(fftgrain->phase[i]);
     65    }
     66   
     67    /*
    5368    fftwf_plan plan;
    5469   
     
    5772   
    5873    fftwf_execute(plan);
    59     fftwf_destroy_plan(plan);
     74    fftwf_destroy_plan(plan);*/
    6075
    6176    return XTRACT_SUCCESS;
  • src/mfcc.h

    rdcc649c r71b1b4b  
    2424#define MFCC_H
    2525
     26#include "filterbank.h"
    2627
    2728//libXtract enums
Note: See TracChangeset for help on using the changeset viewer.