aubio 0.4.5

spectral/awhitening.h

Go to the documentation of this file.
00001 /*
00002   Copyright (C) 2003-2015 Paul Brossier <piem@aubio.org>
00003 
00004   This file is part of aubio.
00005 
00006   aubio is free software: you can redistribute it and/or modify
00007   it under the terms of the GNU General Public License as published by
00008   the Free Software Foundation, either version 3 of the License, or
00009   (at your option) any later version.
00010 
00011   aubio is distributed in the hope that it will be useful,
00012   but WITHOUT ANY WARRANTY; without even the implied warranty of
00013   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014   GNU General Public License for more details.
00015 
00016   You should have received a copy of the GNU General Public License
00017   along with aubio.  If not, see <http://www.gnu.org/licenses/>.
00018 
00019 */
00020 
00021 /** \file
00022 
00023   Spectral adaptive whitening
00024 
00025   References:
00026 
00027   D. Stowell and M. D. Plumbley. Adaptive whitening for improved real-time
00028   audio onset detection. In Proceedings of the International Computer Music
00029   Conference (ICMC), 2007, Copenhagen, Denmark.
00030 
00031   http://www.eecs.qmul.ac.uk/~markp/2007/StowellPlumbley07-icmc.pdf
00032 
00033   S. Böck,, F. Krebs, and M. Schedl. Evaluating the Online Capabilities of
00034   Onset Detection Methods. In Proceedings of the 13th International Society for
00035   Music Information Retrieval Conference (ISMIR), 2012, Porto, Portugal.
00036 
00037   http://ismir2012.ismir.net/event/papers/049_ISMIR_2012.pdf
00038   http://www.cp.jku.at/research/papers/Boeck_etal_ISMIR_2012.pdf
00039 
00040 */
00041 
00042 
00043 #ifndef _AUBIO_SPECTRAL_WHITENING_H
00044 #define _AUBIO_SPECTRAL_WHITENING_H
00045 
00046 #ifdef __cplusplus
00047 extern "C" {
00048 #endif
00049 
00050 /** spectral whitening structure */
00051 typedef struct _aubio_spectral_whitening_t aubio_spectral_whitening_t;
00052 
00053 /** execute spectral adaptive whitening, in-place
00054 
00055   \param o spectral whitening object as returned by new_aubio_spectral_whitening()
00056   \param fftgrain input signal spectrum as computed by aubio_pvoc_do() or aubio_fft_do()
00057 
00058 */
00059 void aubio_spectral_whitening_do (aubio_spectral_whitening_t * o,
00060                                   cvec_t * fftgrain);
00061 
00062 /** creation of a spectral whitening object
00063 
00064   \param buf_size window size of input grains
00065   \param hop_size number of samples between two consecutive input grains
00066   \param samplerate sampling rate of the input signal
00067 
00068 */
00069 aubio_spectral_whitening_t *new_aubio_spectral_whitening (uint_t buf_size,
00070                                                           uint_t hop_size,
00071                                                           uint_t samplerate);
00072 
00073 /** reset spectral whitening object
00074 
00075   \param o spectral whitening object as returned by new_aubio_spectral_whitening()
00076 
00077  */
00078 void aubio_spectral_whitening_reset (aubio_spectral_whitening_t * o);
00079 
00080 /** set relaxation time for spectral whitening
00081 
00082   \param o spectral whitening object as returned by new_aubio_spectral_whitening()
00083   \param relax_time relaxation time in seconds between 20 and 500, defaults 250
00084 
00085   */
00086 uint_t aubio_spectral_whitening_set_relax_time (aubio_spectral_whitening_t * o,
00087     smpl_t relax_time);
00088 
00089 /** get relaxation time of spectral whitening
00090 
00091   \param o spectral whitening object as returned by new_aubio_spectral_whitening()
00092   \return relaxation time in seconds
00093 
00094 */
00095 smpl_t aubio_spectral_whitening_get_relax_time (aubio_spectral_whitening_t * o);
00096 
00097 /** set floor for spectral whitening
00098 
00099   \param o spectral whitening object as returned by new_aubio_spectral_whitening()
00100   \param floor value (typically between 1.e-6 and .2, defaults to 1.e-4)
00101 
00102   */
00103 uint_t aubio_spectral_whitening_set_floor (aubio_spectral_whitening_t * o,
00104     smpl_t floor);
00105 
00106 /** get floor of spectral whitening
00107 
00108   \param o spectral whitening object as returned by new_aubio_spectral_whitening()
00109   \return floor value
00110 
00111 */
00112 smpl_t aubio_spectral_whitening_get_floor (aubio_spectral_whitening_t * o);
00113 
00114 /** deletion of a spectral whitening
00115 
00116   \param o spectral whitening object as returned by new_aubio_spectral_whitening()
00117 
00118 */
00119 void del_aubio_spectral_whitening (aubio_spectral_whitening_t * o);
00120 
00121 #ifdef __cplusplus
00122 }
00123 #endif
00124 
00125 #endif /* _AUBIO_SPECTRAL_WHITENING_H */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines