From 102b732d182ff718dfd3f49365a16195b3441f5a Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Sun, 6 Nov 2005 11:24:13 +0000 Subject: [PATCH] added aubio_tss_set_thres function added aubio_tss_set_thres function --- src/tss.c | 9 ++++++++- src/tss.h | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/tss.c b/src/tss.c index 768a433f..da5a585f 100644 --- a/src/tss.c +++ b/src/tss.c @@ -30,6 +30,7 @@ struct _aubio_tss_t smpl_t alfa; smpl_t beta; smpl_t parm; + smpl_t thrsfact; fvec_t *theta1; fvec_t *theta2; fvec_t *oft1; @@ -91,15 +92,21 @@ void aubio_tss_do(aubio_tss_t *o, cvec_t * input, } } +void aubio_tss_set_thres(aubio_tss_t *o, smpl_t thrs){ + o->thrs = thrs; + o->parm = thrs*o->thrsfact; +} + aubio_tss_t * new_aubio_tss(smpl_t thrs, smpl_t alfa, smpl_t beta, uint_t size, uint_t overlap,uint_t channels) { aubio_tss_t * o = AUBIO_NEW(aubio_tss_t); uint_t rsize = size/2+1; o->thrs = thrs; + o->thrsfact = TWO_PI*overlap/rsize; o->alfa = alfa; o->beta = beta; - o->parm = thrs*TWO_PI*overlap/rsize; + o->parm = thrs*o->thrsfact; o->theta1 = new_fvec(rsize,channels); o->theta2 = new_fvec(rsize,channels); o->oft1 = new_fvec(rsize,channels); diff --git a/src/tss.h b/src/tss.h index 81fbe2b8..a8dd1757 100644 --- a/src/tss.h +++ b/src/tss.h @@ -37,6 +37,8 @@ extern aubio_tss_t * new_aubio_tss(smpl_t thrs, smpl_t alfa, smpl_t beta, /** public deletion function */ extern void del_aubio_tss(aubio_tss_t *s); +extern void aubio_tss_set_thres(aubio_tss_t *tss, smpl_t thrs); + /** split input into transient and steady states components*/ extern void aubio_tss_do(aubio_tss_t *s, cvec_t * input, cvec_t * trans, cvec_t * stead); -- 2.26.2