From: Paul Brossier Date: Fri, 29 Sep 2006 14:50:37 +0000 (+0000) Subject: add some documentation X-Git-Tag: bzr2git~554 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d88ea0643eca24eb5f5d4a9fa6b777872fd1a67f;p=aubio.git add some documentation add some documentation --- diff --git a/src/fft.h b/src/fft.h index d0117980..a2abeca2 100644 --- a/src/fft.h +++ b/src/fft.h @@ -38,8 +38,10 @@ #endif #else #if FFTW3F_SUPPORT +/** fft data type */ #define FFTW_TYPE float #else +/** fft data type */ #define FFTW_TYPE double #endif #endif @@ -48,6 +50,7 @@ extern "C" { #endif +/** fft data type */ typedef FFTW_TYPE fft_data_t; /** FFT object diff --git a/src/filter.h b/src/filter.h index 266befcd..1b0adab4 100644 --- a/src/filter.h +++ b/src/filter.h @@ -66,8 +66,7 @@ void aubio_filter_do_outplace(aubio_filter_t * b, fvec_t * in, fvec_t * out); void aubio_filter_do_filtfilt(aubio_filter_t * b, fvec_t * in, fvec_t * tmp); /** create new IIR filter - \param b vector of forward coefficients - \param a vector of feedback coefficients + \param samplerate signal sampling rate \param order order of the filter (number of coefficients) */ diff --git a/src/hist.h b/src/hist.h index 509e8443..cecbeb2b 100644 --- a/src/hist.h +++ b/src/hist.h @@ -42,10 +42,15 @@ typedef struct _aubio_hist_t aubio_hist_t; aubio_hist_t * new_aubio_hist(smpl_t flow, smpl_t fhig, uint_t nelems, uint_t channels); /** histogram deletion */ void del_aubio_hist(aubio_hist_t *s); +/** compute the histogram */ void aubio_hist_do(aubio_hist_t *s, fvec_t * input); +/** compute the histogram ignoring null elements */ void aubio_hist_do_notnull(aubio_hist_t *s, fvec_t * input); +/** compute the mean of the histogram */ smpl_t aubio_hist_mean(aubio_hist_t *s); +/** weight the histogram */ void aubio_hist_weigth(aubio_hist_t *s); +/** compute dynamic histogram for non-null elements */ void aubio_hist_dyn_notnull (aubio_hist_t *s, fvec_t *input); #ifdef __cplusplus diff --git a/src/mathutils.h b/src/mathutils.h index bd5ba1a9..dc130de3 100644 --- a/src/mathutils.h +++ b/src/mathutils.h @@ -118,13 +118,14 @@ smpl_t vec_local_hfc(fvec_t * f); * \bug should not use POW :( */ smpl_t vec_alpha_norm(fvec_t * DF, smpl_t alpha); -/* dc(min) removal */ +/** dc(min) removal */ void vec_dc_removal(fvec_t * mag); /** alpha normalisation */ void vec_alpha_normalise(fvec_t * mag, uint_t alpha); - +/** add a constant to all members of a vector */ void vec_add(fvec_t * mag, smpl_t threshold); +/** compute adaptive threshold of input vector */ void vec_adapt_thres(fvec_t * vec, fvec_t * tmp, uint_t win_post, uint_t win_pre); /** adaptative thresholding @@ -181,14 +182,22 @@ smpl_t aubio_quadfrac(smpl_t s0, smpl_t s1, smpl_t s2, smpl_t pf); /** returns 1 if X1 is a peak and positive */ uint_t vec_peakpick(fvec_t * input, uint_t pos); +/** convert frequency bin to midi value */ smpl_t aubio_bintomidi(smpl_t bin, smpl_t samplerate, smpl_t fftsize); +/** convert midi value to frequency bin */ smpl_t aubio_miditobin(smpl_t midi, smpl_t samplerate, smpl_t fftsize); +/** convert frequency bin to frequency (Hz) */ smpl_t aubio_bintofreq(smpl_t bin, smpl_t samplerate, smpl_t fftsize); +/** convert frequency (Hz) to frequency bin */ smpl_t aubio_freqtobin(smpl_t freq, smpl_t samplerate, smpl_t fftsize); +/** convert frequency (Hz) to midi value (0-128) */ smpl_t aubio_freqtomidi(smpl_t freq); +/** convert midi value (0-128) to frequency (Hz) */ smpl_t aubio_miditofreq(smpl_t midi); +/** check if current buffer level is under a given threshold */ uint_t aubio_silence_detection(fvec_t * ibuf, smpl_t threshold); +/** get the current buffer level */ smpl_t aubio_level_detection(fvec_t * ibuf, smpl_t threshold); /** * calculate normalised autocorrelation function diff --git a/src/peakpick.h b/src/peakpick.h index 75552655..3d391f48 100644 --- a/src/peakpick.h +++ b/src/peakpick.h @@ -30,20 +30,31 @@ extern "C" { #endif +/** function pointer to thresholding function */ typedef smpl_t (*aubio_thresholdfn_t)(fvec_t *input); +/** function pointer to peak-picking function */ typedef uint_t (*aubio_pickerfn_t)(fvec_t *input, uint_t pos); +/** peak-picker structure */ typedef struct _aubio_pickpeak_t aubio_pickpeak_t; +/** peak-picker creation function */ aubio_pickpeak_t * new_aubio_peakpicker(smpl_t threshold); +/** real time peak picking function */ uint_t aubio_peakpick_pimrt(fvec_t * DF, aubio_pickpeak_t * p); /** function added by Miguel Ramirez to return the onset detection amplitude in peakval */ uint_t aubio_peakpick_pimrt_wt( fvec_t* DF, aubio_pickpeak_t* p, smpl_t* peakval ); +/** get current peak value */ smpl_t aubio_peakpick_pimrt_getval(aubio_pickpeak_t * p); +/** destroy peak picker structure */ void del_aubio_peakpicker(aubio_pickpeak_t * p); +/** set peak picking threshold */ void aubio_peakpicker_set_threshold(aubio_pickpeak_t * p, smpl_t threshold); +/** get peak picking threshold */ smpl_t aubio_peakpicker_get_threshold(aubio_pickpeak_t * p); +/** set peak picker thresholding function */ void aubio_peakpicker_set_thresholdfn(aubio_pickpeak_t * p, aubio_thresholdfn_t thresholdfn); +/** get peak picker thresholding function */ aubio_thresholdfn_t aubio_peakpicker_get_thresholdfn(aubio_pickpeak_t * p); #ifdef __cplusplus diff --git a/src/pitchmcomb.h b/src/pitchmcomb.h index eea65647..492c35ec 100644 --- a/src/pitchmcomb.h +++ b/src/pitchmcomb.h @@ -49,6 +49,7 @@ typedef struct _aubio_pitchmcomb_t aubio_pitchmcomb_t; */ smpl_t aubio_pitchmcomb_detect(aubio_pitchmcomb_t * p, cvec_t * fftgrain); +/** select the best candidates */ uint_t aubio_pitch_cands(aubio_pitchmcomb_t * p, cvec_t * fftgrain, smpl_t * cands); /** creation of the pitch detection object diff --git a/src/tempo.h b/src/tempo.h index b1eeccea..c2c835df 100644 --- a/src/tempo.h +++ b/src/tempo.h @@ -17,6 +17,15 @@ */ +/** \file + + Tempo detection driver + + This object stores all the memory required for tempo detection algorithm + and returns the estimated beat locations. + +*/ + #ifndef TEMPO_H #define TEMPO_H @@ -24,6 +33,7 @@ extern "C" { #endif +/** tempo detection structure */ typedef struct _aubio_tempo_t aubio_tempo_t; /** create tempo detection object */