From dea34a1fa660219ac8f27471ec65da0bb16c8b72 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Fri, 27 Jul 2012 10:37:38 -0600 Subject: [PATCH] src/spectral/tss.c: clarify --- src/spectral/tss.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/spectral/tss.c b/src/spectral/tss.c index fec43e48..9b324b9d 100644 --- a/src/spectral/tss.c +++ b/src/spectral/tss.c @@ -60,32 +60,30 @@ void aubio_tss_do(aubio_tss_t *o, cvec_t * input, -2.0*theta1[j]+theta2[j]); theta2[j] = theta1[j]; theta1[j] = input->phas[j]; - } - for (j=0;j parm*oft1[j]); trans->norm[j] = input->norm[j] * test; trans->phas[j] = input->phas[j] * test; - } - for (j=0;jnorm[j] = input->norm[j] * test; stead->phas[j] = input->phas[j] * test; - /*increase sstate probability for sines */ + /*increase probability for transient */ test = (trans->norm[j]==0.); oft1[j] = test; - test = (stead->norm[j]==0.); - oft2[j] = test; test = (trans->norm[j]>0.); oft1[j] += alpha*test; - test = (stead->norm[j]>0.); - oft2[j] += alpha*test; test = (oft1[j]>1. && trans->norm[j]>0.); oft1[j] += beta*test; + + /*increase probability for steady states */ + test = (stead->norm[j]==0.); + oft2[j] = test; + test = (stead->norm[j]>0.); + oft2[j] += alpha*test; test = (oft2[j]>1. && stead->norm[j]>0.); oft2[j] += beta*test; } -- 2.26.2