2 Copyright (C) 2003 Paul Brossier
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 Vector scaling function
23 This object, inspired from the scale object in FTS, the jMax engine, scales
24 the values of a vector according to an affine function defined as follow:
26 \f$ y = (x - ilow)*(ohig-olow)/(ihig-ilow) + olow \f$
37 typedef struct _aubio_scale_t aubio_scale_t;
39 /** create a scale object
41 \param flow lower value of output function
42 \param fhig higher value of output function
43 \param ilow lower value of input function
44 \param ihig higher value of output function
47 aubio_scale_t * new_aubio_scale(smpl_t flow, smpl_t fhig, smpl_t ilow, smpl_t ihig );
48 /** delete a scale object
50 \param s scale object as returned by new_aubio_scale
53 void del_aubio_scale(aubio_scale_t *s);
54 /** scale input vector
56 \param s scale object as returned by new_aubio_scale
57 \param input vector to scale
60 void aubio_scale_do(aubio_scale_t *s, fvec_t * input);
61 /** modify scale parameters after object creation
63 \param s scale object as returned by new_aubio_scale
64 \param olow lower value of output function
65 \param ohig higher value of output function
66 \param ilow lower value of input function
67 \param ihig higher value of output function
70 void aubio_scale_set (aubio_scale_t *s, smpl_t ilow, smpl_t ihig, smpl_t olow, smpl_t ohig);