Ignore:
Timestamp:
Sep 29, 2009, 7:43:12 AM (15 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:
c159aeb
Parents:
d9c45df
Message:

src/temporal: revamp filter object, clarify API for A- and C-weighting filters,
add coefficients for 8000 16000 22050 44100 96000 192000, improve documentation,
remove unneeded filter_priv.h, add A and C weighting tests.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/temporal/filter.c

    rd9c45df ra4364b8  
    2727#include "mathutils.h"
    2828#include "temporal/filter.h"
    29 #include "temporal/filter_priv.h"
     29
     30struct _aubio_filter_t {
     31  uint_t order;
     32  uint_t samplerate;
     33  lvec_t * a;
     34  lvec_t * b;
     35  lvec_t * y;
     36  lvec_t * x;
     37};
    3038
    3139void aubio_filter_do(aubio_filter_t * f, fvec_t * in) {
     
    103111}
    104112
    105 aubio_filter_t * new_aubio_filter(uint_t samplerate UNUSED, uint_t order, uint_t channels) {
     113lvec_t * aubio_filter_get_feedback ( aubio_filter_t *f ) {
     114  return f->a;
     115}
     116
     117lvec_t * aubio_filter_get_feedforward ( aubio_filter_t *f ) {
     118  return f->b;
     119}
     120
     121uint_t aubio_filter_get_order ( aubio_filter_t *f ) {
     122  return f->order;
     123}
     124
     125uint_t aubio_filter_get_samplerate ( aubio_filter_t *f ) {
     126  return f->samplerate;
     127}
     128
     129aubio_filter_t * new_aubio_filter(uint_t samplerate,
     130    uint_t order, uint_t channels) {
    106131  aubio_filter_t * f = AUBIO_NEW(aubio_filter_t);
    107132  f->x = new_lvec(order, channels);
     
    109134  f->a = new_lvec(order, 1);
    110135  f->b = new_lvec(order, 1);
     136  f->samplerate = samplerate;
     137  f->order = order;
     138  /* set default to identity */
    111139  f->a->data[0][1] = 1.;
    112   f->order = order;
    113140  return f;
    114141}
    115142
    116143void del_aubio_filter(aubio_filter_t * f) {
    117   AUBIO_FREE(f->a);
    118   AUBIO_FREE(f->b);
    119   AUBIO_FREE(f->x);
    120   AUBIO_FREE(f->y);
     144  del_lvec(f->a);
     145  del_lvec(f->b);
     146  del_lvec(f->x);
     147  del_lvec(f->y);
    121148  AUBIO_FREE(f);
    122149  return;
Note: See TracChangeset for help on using the changeset viewer.