shithub: aubio

Download patch

ref: 102b732d182ff718dfd3f49365a16195b3441f5a
parent: 197571a68720b9cceafb22353d2bb6a654ed2a4a
author: Paul Brossier <piem@altern.org>
date: Sun Nov 6 06:24:13 EST 2005

added aubio_tss_set_thres function
added aubio_tss_set_thres function


--- a/src/tss.c
+++ b/src/tss.c
@@ -30,6 +30,7 @@
   smpl_t alfa;
   smpl_t beta;
   smpl_t parm;
+  smpl_t thrsfact;
   fvec_t *theta1;
   fvec_t *theta2;
   fvec_t *oft1;
@@ -91,6 +92,11 @@
   }
 }
 
+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)
 {
@@ -97,9 +103,10 @@
   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);
--- a/src/tss.h
+++ b/src/tss.h
@@ -37,6 +37,8 @@
 /** 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);