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