Changeset 4f4d892 for src/temporal


Ignore:
Timestamp:
Dec 1, 2007, 9:53:24 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:
4123f16
Parents:
0380645
Message:

src/temporal: split aubio_adsgn_filter and aubio_cdsgn_filter to separate files

Location:
src/temporal
Files:
5 added
2 edited

Legend:

Unmodified
Added
Removed
  • src/temporal/filter.c

    r0380645 r4f4d892  
    2626#include "mathutils.h"
    2727#include "temporal/filter.h"
    28 
    29 struct _aubio_filter_t {
    30   uint_t order;
    31   lsmp_t * a;
    32   lsmp_t * b;
    33   lsmp_t * y;
    34   lsmp_t * x;
    35 };
     28#include "temporal/filter_priv.h"
    3629
    3730/* bug: mono only */
     
    133126}
    134127
    135 
    136 aubio_filter_t * new_aubio_adsgn_filter(uint_t samplerate) {
    137   aubio_filter_t * f = new_aubio_filter(samplerate, 7);
    138   lsmp_t * a = f->a;
    139   lsmp_t * b = f->b;
    140   /* uint_t l; */
    141   /* for now, 44100, adsgn */
    142   a[0] =  1.00000000000000000000000000000000000000000000000000000;
    143   a[1] = -4.01957618111583236952810693765059113502502441406250000;
    144   a[2] =  6.18940644292069386267485242569819092750549316406250000;
    145   a[3] = -4.45319890354411640487342083360999822616577148437500000;
    146   a[4] =  1.42084294962187751565352300531230866909027099609375000;
    147   a[5] = -0.14182547383030480458998567883099894970655441284179688;
    148   a[6] =  0.00435117723349511334451911181986361043527722358703613;
    149   b[0] =  0.25574112520425740235907596797915175557136535644531250;
    150   b[1] = -0.51148225040851391653973223583307117223739624023437500;
    151   b[2] = -0.25574112520426162120656954357400536537170410156250000;
    152   b[3] =  1.02296450081703405032840237254276871681213378906250000;
    153   b[4] = -0.25574112520426051098354491841746494174003601074218750;
    154   b[5] = -0.51148225040851369449512731080176308751106262207031250;
    155   b[6] =  0.25574112520425729133677350546349771320819854736328125;
    156   /* DBG: filter coeffs at creation time */
    157   /*
    158   for (l=0; l<f->order; l++){
    159     AUBIO_DBG("a[%d]=\t%1.16f\tb[%d]=\t%1.16f\n",l,a[l],l,b[l]);
    160   }
    161   */
    162   f->a = a;
    163   f->b = b;
    164   return f;
    165 }
    166 
    167 aubio_filter_t * new_aubio_cdsgn_filter(uint_t samplerate) {
    168   aubio_filter_t * f = new_aubio_filter(samplerate, 5);
    169   lsmp_t * a = f->a;
    170   lsmp_t * b = f->b;
    171   /* uint_t l; */
    172   /* for now, 44100, cdsgn */
    173   a[0] =  1.000000000000000000000000000000000000000000000000000000000000;
    174   a[1] = -2.134674963687040794013682898366823792457580566406250000000000;
    175   a[2] =  1.279333533236063358273781886964570730924606323242187500000000;
    176   a[3] = -0.149559846089396208945743182994192466139793395996093750000000;
    177   a[4] =  0.004908700174624848651394604104325480875559151172637939453125;
    178   b[0] =  0.217008561949218803377448239189106971025466918945312500000000;
    179   b[1] = -0.000000000000000222044604925031308084726333618164062500000000;
    180   b[2] = -0.434017123898438272888711253472138196229934692382812500000000;
    181   b[3] =  0.000000000000000402455846426619245903566479682922363281250000;
    182   b[4] =  0.217008561949218969910901932962588034570217132568359375000000;
    183   /* DBG: filter coeffs at creation time */
    184   /*
    185   for (l=0; l<f->order; l++){
    186     AUBIO_DBG("a[%d]=\t%1.16f\tb[%d]=\t%1.16f\n",l,a[l],l,b[l]);
    187   }
    188   */
    189   f->a = a;
    190   f->b = b;
    191   return f;
    192 }
    193 
    194128aubio_filter_t * new_aubio_filter(uint_t samplerate UNUSED, uint_t order) {
    195129  aubio_filter_t * f = AUBIO_NEW(aubio_filter_t);
  • src/temporal/filter.h

    r0380645 r4f4d892  
    7272*/
    7373aubio_filter_t * new_aubio_filter(uint_t samplerate, uint_t order);
    74 /** create a new A-design filter
    75 
    76   \param samplerate sampling-rate of the signal to filter
    77 
    78 */
    79 aubio_filter_t * new_aubio_adsgn_filter(uint_t samplerate);
    80 /** create a new C-design filter
    81 
    82   \param samplerate sampling-rate of the signal to filter
    83 
    84 */
    85 aubio_filter_t * new_aubio_cdsgn_filter(uint_t samplerate);
    8674/** delete a filter object
    8775 
Note: See TracChangeset for help on using the changeset viewer.