Changeset 17961b0


Ignore:
Timestamp:
Sep 17, 2007, 12:50:05 AM (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:
914a8cc
Parents:
ff68b34
Message:

filterbank.{c,h}: add aubio_filterbank_get_channel function

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/filterbank.c

    rff68b34 r17961b0  
    2323#include "sample.h"
    2424#include "filterbank.h"
     25#include "mathutils.h"
    2526
    2627#include "stdio.h"
     
    125126  //filling the fft_freqs lookup table, which assigns the frequency in hz to each bin
    126127  for(bin_cnt=0; bin_cnt<win_s; bin_cnt++){
    127     //TODO: check the formula!
    128     fft_freqs->data[0][bin_cnt]= (smpl_t)samplerate* (smpl_t)bin_cnt/ (smpl_t)win_s;
     128    fft_freqs->data[0][bin_cnt]= aubio_bintofreq(bin_cnt, samplerate, win_s);
    129129  }
    130130
     
    215215  return;
    216216}
     217
     218fvec_t * aubio_filterbank_getchannel(aubio_filterbank_t * f, uint_t channel) {
     219  if ( (channel >= 0) && (channel < f->n_filters) ) { return f->filters[channel]; }
     220  else { return NULL; }
     221}
  • src/filterbank.h

    rff68b34 r17961b0  
    6868void aubio_filterbank_do(aubio_filterbank_t * fb, cvec_t * in, fvec_t *out);
    6969
     70/** return the vector containing the filter coefficients of one channel
     71
     72 */
     73fvec_t * aubio_filterbank_getchannel(aubio_filterbank_t * f, uint_t channel);
     74
    7075#ifdef __cplusplus
    7176}
Note: See TracChangeset for help on using the changeset viewer.