shithub: aubio

Download patch

ref: 680137a49b2869e196993d71ab63e98d91a9f687
parent: 0dc5fe3f13928430b83a106c3867b5f1f34fd9d6
author: Paul Brossier <piem@altern.org>
date: Wed May 17 15:49:03 EDT 2006

update scale.[ch] docs
update scale.[ch] docs


--- 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 @@
 	*/
 };
 
-
-/********************************************************
- * Object Memory Allocation
- */
-
 static aubio_scale_t * aubio_scale_malloc(void);
 static void aubio_scale_free(aubio_scale_t * s);
 
@@ -52,9 +47,6 @@
 	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 @@
 	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 @@
 	}
 }
 
-/***
- * do it
- */
 void aubio_scale_do (aubio_scale_t *s, fvec_t *input) 
 {
 	uint_t i, j;
--- 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
--