aubio  0.3.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
mathutils.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2003 Paul Brossier
3 
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.
8 
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.
13 
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.
17 
18 */
19 
29 #ifndef MATHUTILS_H
30 #define MATHUTILS_H
31 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
45 typedef enum {
46  aubio_win_rectangle,
47  aubio_win_hamming,
48  aubio_win_hanning,
49  aubio_win_hanningz,
50  aubio_win_blackman,
51  aubio_win_blackman_harris,
52  aubio_win_gaussian,
53  aubio_win_welch,
54  aubio_win_parzen
56 
58 void aubio_window(smpl_t *w, uint_t size, aubio_window_type wintype);
59 
65 
99 void vec_shift(fvec_t *s);
101 smpl_t vec_sum(fvec_t *s);
120 smpl_t vec_alpha_norm(fvec_t * DF, smpl_t alpha);
122 void vec_dc_removal(fvec_t * mag);
124 void vec_alpha_normalise(fvec_t * mag, uint_t alpha);
126 void vec_add(fvec_t * mag, smpl_t threshold);
127 
129 void vec_adapt_thres(fvec_t * vec, fvec_t * tmp,
130  uint_t win_post, uint_t win_pre);
150 smpl_t vec_moving_thres(fvec_t * vec, fvec_t * tmp,
151  uint_t win_post, uint_t win_pre, uint_t win_pos);
152 
162 smpl_t vec_median(fvec_t * input);
163 
166 
168 smpl_t vec_quadint_min(fvec_t * x,uint_t pos, uint_t span);
169 
181 
183 uint_t vec_peakpick(fvec_t * input, uint_t pos);
184 
186 smpl_t aubio_bintomidi(smpl_t bin, smpl_t samplerate, smpl_t fftsize);
188 smpl_t aubio_miditobin(smpl_t midi, smpl_t samplerate, smpl_t fftsize);
190 smpl_t aubio_bintofreq(smpl_t bin, smpl_t samplerate, smpl_t fftsize);
192 smpl_t aubio_freqtobin(smpl_t freq, smpl_t samplerate, smpl_t fftsize);
197 
199 uint_t aubio_silence_detection(fvec_t * ibuf, smpl_t threshold);
201 smpl_t aubio_level_detection(fvec_t * ibuf, smpl_t threshold);
205 void aubio_autocorr(fvec_t * input, fvec_t * output);
213 void aubio_cleanup(void);
214 
215 #ifdef __cplusplus
216 }
217 #endif
218 
219 #endif
220