From 680137a49b2869e196993d71ab63e98d91a9f687 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Wed, 17 May 2006 19:49:03 +0000 Subject: [PATCH] update scale.[ch] docs update scale.[ch] docs --- src/scale.c | 16 +--------------- src/scale.h | 47 +++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 42 insertions(+), 21 deletions(-) diff --git a/src/scale.c b/src/scale.c index c018eae0..57fc7675 100644 --- a/src/scale.c +++ b/src/scale.c @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ +*/ #include "aubio_priv.h" #include "sample.h" @@ -35,11 +35,6 @@ struct _aubio_scale_t { */ }; - -/******************************************************** - * Object Memory Allocation - */ - static aubio_scale_t * aubio_scale_malloc(void); static void aubio_scale_free(aubio_scale_t * s); @@ -52,9 +47,6 @@ void aubio_scale_free(aubio_scale_t * s) { AUBIO_FREE(s); } -/*** - * Object creation/deletion calls - */ aubio_scale_t * new_aubio_scale (smpl_t ilow, smpl_t ihig, smpl_t olow, smpl_t ohig ){ aubio_scale_t * s = aubio_scale_malloc(); aubio_scale_set (s, ilow, ihig, olow, ohig); @@ -65,9 +57,6 @@ void del_aubio_scale(aubio_scale_t *s) { aubio_scale_free(s); } -/*** - * set parmams - */ void aubio_scale_set (aubio_scale_t *s, smpl_t ilow, smpl_t ihig, smpl_t olow, smpl_t ohig) { smpl_t inputrange = ihig - ilow; @@ -85,9 +74,6 @@ void aubio_scale_set (aubio_scale_t *s, smpl_t ilow, smpl_t ihig, smpl_t olow, s } } -/*** - * do it - */ void aubio_scale_do (aubio_scale_t *s, fvec_t *input) { uint_t i, j; diff --git a/src/scale.h b/src/scale.h index 6bc1e583..796f35e6 100644 --- a/src/scale.h +++ b/src/scale.h @@ -14,8 +14,18 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ +*/ +/** \file + + Vector scaling function + + This object, inspired from the scale object in FTS, the jMax engine, scales + the values of a vector according to an affine function defined as follow: + + \f$ y = (x - ilow)*(ohig-olow)/(ihig-ilow) + olow \f$ + +*/ #ifndef SCALE_H #define SCALE_H @@ -23,15 +33,40 @@ extern "C" { #endif -/* inspired from the scale object in fts (jmax) */ - +/** scale object */ typedef struct _aubio_scale_t aubio_scale_t; -/* buffer function */ +/** create a scale object + + \param flow lower value of output function + \param fhig higher value of output function + \param ilow lower value of input function + \param ihig higher value of output function + +*/ aubio_scale_t * new_aubio_scale(smpl_t flow, smpl_t fhig, smpl_t ilow, smpl_t ihig ); +/** delete a scale object + + \param s scale object as returned by new_aubio_scale + +*/ void del_aubio_scale(aubio_scale_t *s); -void aubio_scale_do(aubio_scale_t *s, - fvec_t * input); +/** scale input vector + + \param s scale object as returned by new_aubio_scale + \param input vector to scale + +*/ +void aubio_scale_do(aubio_scale_t *s, fvec_t * input); +/** modify scale parameters after object creation + + \param s scale object as returned by new_aubio_scale + \param olow lower value of output function + \param ohig higher value of output function + \param ilow lower value of input function + \param ihig higher value of output function + +*/ void aubio_scale_set (aubio_scale_t *s, smpl_t ilow, smpl_t ihig, smpl_t olow, smpl_t ohig); #ifdef __cplusplus -- 2.26.2