00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00029 #ifndef MATHUTILS_H
00030 #define MATHUTILS_H
00031
00041 #ifdef __cplusplus
00042 extern "C" {
00043 #endif
00044
00045 typedef enum {
00046 aubio_win_rectangle,
00047 aubio_win_hamming,
00048 aubio_win_hanning,
00049 aubio_win_hanningz,
00050 aubio_win_blackman,
00051 aubio_win_blackman_harris,
00052 aubio_win_gaussian,
00053 aubio_win_welch,
00054 aubio_win_parzen
00055 } aubio_window_type;
00056
00058 void aubio_window(smpl_t *w, uint_t size, aubio_window_type wintype);
00059
00064 smpl_t aubio_unwrap2pi (smpl_t phase);
00065
00070 smpl_t vec_mean(fvec_t *s);
00075 smpl_t vec_max(fvec_t *s);
00080 smpl_t vec_min(fvec_t *s);
00085 uint_t vec_min_elem(fvec_t *s);
00090 uint_t vec_max_elem(fvec_t *s);
00099 void vec_shift(fvec_t *s);
00101 smpl_t vec_sum(fvec_t *s);
00106 smpl_t vec_local_energy(fvec_t * f);
00110 smpl_t vec_local_hfc(fvec_t * f);
00120 smpl_t vec_alpha_norm(fvec_t * DF, smpl_t alpha);
00122 void vec_dc_removal(fvec_t * mag);
00124 void vec_alpha_normalise(fvec_t * mag, uint_t alpha);
00126 void vec_add(fvec_t * mag, smpl_t threshold);
00127
00129 void vec_adapt_thres(fvec_t * vec, fvec_t * tmp,
00130 uint_t win_post, uint_t win_pre);
00150 smpl_t vec_moving_thres(fvec_t * vec, fvec_t * tmp,
00151 uint_t win_post, uint_t win_pre, uint_t win_pos);
00152
00162 smpl_t vec_median(fvec_t * input);
00163
00165 smpl_t vec_quadint(fvec_t * x,uint_t pos);
00166
00168 smpl_t vec_quadint_min(fvec_t * x,uint_t pos, uint_t span);
00169
00180 smpl_t aubio_quadfrac(smpl_t s0, smpl_t s1, smpl_t s2, smpl_t pf);
00181
00183 uint_t vec_peakpick(fvec_t * input, uint_t pos);
00184
00186 smpl_t aubio_bintomidi(smpl_t bin, smpl_t samplerate, smpl_t fftsize);
00188 smpl_t aubio_miditobin(smpl_t midi, smpl_t samplerate, smpl_t fftsize);
00190 smpl_t aubio_bintofreq(smpl_t bin, smpl_t samplerate, smpl_t fftsize);
00192 smpl_t aubio_freqtobin(smpl_t freq, smpl_t samplerate, smpl_t fftsize);
00194 smpl_t aubio_freqtomidi(smpl_t freq);
00196 smpl_t aubio_miditofreq(smpl_t midi);
00197
00199 uint_t aubio_silence_detection(fvec_t * ibuf, smpl_t threshold);
00201 smpl_t aubio_level_detection(fvec_t * ibuf, smpl_t threshold);
00205 void aubio_autocorr(fvec_t * input, fvec_t * output);
00213 void aubio_cleanup(void);
00214
00215 #ifdef __cplusplus
00216 }
00217 #endif
00218
00219 #endif
00220