Changeset b01bd4a for src/onset


Ignore:
Timestamp:
Oct 19, 2009, 2:45:13 PM (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:
b849106
Parents:
59c046d
Message:

src/temporal: derive biquad from filter, use in peakpicker

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/onset/peakpick.c

    r59c046d rb01bd4a  
    2121#include "fvec.h"
    2222#include "mathutils.h"
     23#include "lvec.h"
     24#include "temporal/filter.h"
    2325#include "temporal/biquad.h"
    2426#include "onset/peakpick.h"
     
    4345
    4446        /** biquad lowpass filter */
    45         aubio_biquad_t * biquad;
     47        aubio_filter_t * biquad;
    4648        /** original onsets */
    4749        fvec_t * onset_keep;
     
    9597  /* filter onset_proc */
    9698  /** \bug filtfilt calculated post+pre times, should be only once !? */
    97   //aubio_biquad_do_filtfilt(p->biquad,onset_proc,scratch);
     99  aubio_filter_do_filtfilt (p->biquad, onset_proc, scratch);
    98100
    99101  for (i = 0; i < p->channels; i++) {
     
    160162        t->onset_peek = new_fvec(3, channels);
    161163
    162         /* cutoff: low-pass filter cutoff [0.34, 1] */
    163         /* t->cutoff=0.34; */
    164         t->biquad = new_aubio_biquad(0.1600,0.3200,0.1600,-0.5949,0.2348);
     164        /* cutoff: low-pass filter with cutoff reduced frequency at 0.34
     165   generated with octave butter function: [b,a] = butter(2, 0.34);
     166   */
     167  t->biquad = new_aubio_filter_biquad (0.15998789, 0.31997577, 0.15998789,
     168    -0.59488894, 0.23484048, channels);
     169
    165170        return t;
    166171}
    167172
    168173void del_aubio_peakpicker(aubio_peakpicker_t * p) {
    169         del_aubio_biquad(p->biquad);
     174        del_aubio_filter(p->biquad);
    170175        del_fvec(p->onset_keep);
    171176        del_fvec(p->onset_proc);
Note: See TracChangeset for help on using the changeset viewer.