aubio 0.4.5

spectral/specdesc.h

Go to the documentation of this file.
00001 /*
00002   Copyright (C) 2003-2013 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 description functions
00024 
00025   All of the following spectral description functions take as arguments the FFT
00026   of a windowed signal (as created with aubio_pvoc). They output one smpl_t per
00027   buffer (stored in a vector of size [1]).
00028 
00029   \section specdesc Spectral description functions
00030 
00031   A list of the spectral description methods currently available follows.
00032 
00033   \subsection onsetdesc Onset detection functions
00034 
00035   These functions are designed to raise at notes attacks in music signals.
00036 
00037   \b \p energy : Energy based onset detection function
00038 
00039   This function calculates the local energy of the input spectral frame.
00040 
00041   \b \p hfc : High Frequency Content onset detection function
00042 
00043   This method computes the High Frequency Content (HFC) of the input spectral
00044   frame. The resulting function is efficient at detecting percussive onsets.
00045 
00046   Paul Masri. Computer modeling of Sound for Transformation and Synthesis of
00047   Musical Signal. PhD dissertation, University of Bristol, UK, 1996.
00048 
00049   \b \p complex : Complex Domain Method onset detection function
00050 
00051   Christopher Duxbury, Mike E. Davies, and Mark B. Sandler. Complex domain
00052   onset detection for musical signals. In Proceedings of the Digital Audio
00053   Effects Conference, DAFx-03, pages 90-93, London, UK, 2003.
00054 
00055   \b \p phase : Phase Based Method onset detection function
00056 
00057   Juan-Pablo Bello, Mike P. Davies, and Mark B. Sandler. Phase-based note onset
00058   detection for music signals. In Proceedings of the IEEE International
00059   Conference on Acoustics Speech and Signal Processing, pages 441­444,
00060   Hong-Kong, 2003.
00061 
00062   \b \p wphase : Weighted Phase Deviation onset detection function
00063 
00064   S. Dixon. Onset detection revisited. In Proceedings of the 9th International
00065   Conference on Digital Audio Ef- fects (DAFx) , pages 133–137, 2006.
00066 
00067   http://www.eecs.qmul.ac.uk/~simond/pub/2006/dafx.pdf
00068 
00069   \b \p specdiff : Spectral difference method onset detection function
00070 
00071   Jonhatan Foote and Shingo Uchihashi. The beat spectrum: a new approach to
00072   rhythm analysis. In IEEE International Conference on Multimedia and Expo
00073   (ICME 2001), pages 881­884, Tokyo, Japan, August 2001.
00074 
00075   \b \p kl : Kullback-Liebler onset detection function
00076 
00077   Stephen Hainsworth and Malcom Macleod. Onset detection in music audio
00078   signals. In Proceedings of the International Computer Music Conference
00079   (ICMC), Singapore, 2003.
00080 
00081   \b \p mkl : Modified Kullback-Liebler onset detection function
00082 
00083   Paul Brossier, ``Automatic annotation of musical audio for interactive
00084   systems'', Chapter 2, Temporal segmentation, PhD thesis, Centre for Digital
00085   music, Queen Mary University of London, London, UK, 2006.
00086 
00087   \b \p specflux : Spectral Flux
00088 
00089   Simon Dixon, Onset Detection Revisited, in ``Proceedings of the 9th
00090   International Conference on Digital Audio Effects'' (DAFx-06), Montreal,
00091   Canada, 2006.
00092 
00093   \subsection shapedesc Spectral shape descriptors
00094 
00095   The following descriptors are described in:
00096 
00097   Geoffroy Peeters, <i>A large set of audio features for sound description
00098   (similarity and classification) in the CUIDADO project</i>, CUIDADO I.S.T.
00099   Project Report 2004 (<a
00100   href="http://www.ircam.fr/anasyn/peeters/ARTICLES/Peeters_2003_cuidadoaudiofeatures.pdf">pdf</a>)
00101 
00102   \b \p centroid : Spectral centroid
00103 
00104   The spectral centroid represents the barycenter of the spectrum.
00105 
00106   \e Note: This function returns the result in bin. To get the spectral
00107   centroid in Hz, aubio_bintofreq() should be used.
00108 
00109   \b \p spread : Spectral spread
00110 
00111   The spectral spread is the variance of the spectral distribution around its
00112   centroid.
00113 
00114   See also <a href="http://en.wikipedia.org/wiki/Standard_deviation">Standard
00115   deviation</a> on Wikipedia.
00116 
00117   \b \p skewness : Spectral skewness
00118 
00119   Similarly, the skewness is computed from the third order moment of the
00120   spectrum. A negative skewness indicates more energy on the lower part of the
00121   spectrum. A positive skewness indicates more energy on the high frequency of
00122   the spectrum.
00123 
00124   See also <a href="http://en.wikipedia.org/wiki/Skewness">Skewness</a> on
00125   Wikipedia.
00126 
00127   \b \p kurtosis : Spectral kurtosis
00128 
00129   The kurtosis is a measure of the flatness of the spectrum, computed from the
00130   fourth order moment.
00131 
00132   See also <a href="http://en.wikipedia.org/wiki/Kurtosis">Kurtosis</a> on
00133   Wikipedia.
00134 
00135   \b \p slope : Spectral slope
00136 
00137   The spectral slope represents decreasing rate of the spectral amplitude,
00138   computed using a linear regression.
00139 
00140   \b \p decrease : Spectral decrease
00141 
00142   The spectral decrease is another representation of the decreasing rate,
00143   based on perceptual criteria.
00144 
00145   \b \p rolloff : Spectral roll-off
00146 
00147   This function returns the bin number below which 95% of the spectrum energy
00148   is found.
00149 
00150   \example spectral/test-specdesc.c
00151 
00152 */
00153 
00154 
00155 #ifndef AUBIO_SPECDESC_H
00156 #define AUBIO_SPECDESC_H
00157 
00158 #ifdef __cplusplus
00159 extern "C" {
00160 #endif
00161 
00162 /** spectral description structure */
00163 typedef struct _aubio_specdesc_t aubio_specdesc_t;
00164 
00165 /** execute spectral description function on a spectral frame
00166 
00167   Generic function to compute spectral description.
00168 
00169   \param o spectral description object as returned by new_aubio_specdesc()
00170   \param fftgrain input signal spectrum as computed by aubio_pvoc_do
00171   \param desc output vector (one sample long, to send to the peak picking)
00172 
00173 */
00174 void aubio_specdesc_do (aubio_specdesc_t * o, const cvec_t * fftgrain,
00175     fvec_t * desc);
00176 
00177 /** creation of a spectral description object
00178 
00179   \param method spectral description method
00180   \param buf_size length of the input spectrum frame
00181 
00182   The parameter \p method is a string that can be any of:
00183 
00184     - onset novelty functions: `complex`, `energy`, `hfc`, `kl`, `mkl`,
00185     `phase`, `specdiff`, `specflux`, `wphase`,
00186 
00187     - spectral descriptors: `centroid`, `decrease`, `kurtosis`, `rolloff`,
00188     `skewness`, `slope`, `spread`.
00189 
00190 */
00191 aubio_specdesc_t *new_aubio_specdesc (const char_t * method, uint_t buf_size);
00192 
00193 /** deletion of a spectral descriptor
00194 
00195   \param o spectral descriptor object as returned by new_aubio_specdesc()
00196 
00197 */
00198 void del_aubio_specdesc (aubio_specdesc_t * o);
00199 
00200 #ifdef __cplusplus
00201 }
00202 #endif
00203 
00204 #endif /* AUBIO_SPECDESC_H */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines