source: src/spectral/awhitening.h @ ee123a0

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5
Last change on this file since ee123a0 was fa0ef3b, checked in by Paul Brossier <piem@piem.org>, 8 years ago

src/spectral/awhitening.h: add _set_floor/_get_floor, improve documentation

  • Property mode set to 100644
File size: 3.9 KB
Line 
1/*
2  Copyright (C) 2003-2015 Paul Brossier <piem@aubio.org>
3
4  This file is part of aubio.
5
6  aubio is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10
11  aubio is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  GNU General Public License for more details.
15
16  You should have received a copy of the GNU General Public License
17  along with aubio.  If not, see <http://www.gnu.org/licenses/>.
18
19*/
20
21/** \file
22
23  Spectral adaptive whitening
24
25  References:
26
27  D. Stowell and M. D. Plumbley. Adaptive whitening for improved real-time
28  audio onset detection. In Proceedings of the International Computer Music
29  Conference (ICMC), 2007, Copenhagen, Denmark.
30
31  http://www.eecs.qmul.ac.uk/~markp/2007/StowellPlumbley07-icmc.pdf
32
33  S. Böck,, F. Krebs, and M. Schedl. Evaluating the Online Capabilities of
34  Onset Detection Methods. In Proceedings of the 13th International Society for
35  Music Information Retrieval Conference (ISMIR), 2012, Porto, Portugal.
36
37  http://ismir2012.ismir.net/event/papers/049_ISMIR_2012.pdf
38  http://www.cp.jku.at/research/papers/Boeck_etal_ISMIR_2012.pdf
39
40*/
41
42
43#ifndef _AUBIO_SPECTRAL_WHITENING_H
44#define _AUBIO_SPECTRAL_WHITENING_H
45
46#ifdef __cplusplus
47extern "C" {
48#endif
49
50/** spectral whitening structure */
51typedef struct _aubio_spectral_whitening_t aubio_spectral_whitening_t;
52
53/** execute spectral adaptive whitening, in-place
54
55  \param o spectral whitening object as returned by new_aubio_spectral_whitening()
56  \param fftgrain input signal spectrum as computed by aubio_pvoc_do() or aubio_fft_do()
57
58*/
59void aubio_spectral_whitening_do (aubio_spectral_whitening_t * o,
60                                  cvec_t * fftgrain);
61
62/** creation of a spectral whitening object
63
64  \param buf_size window size of input grains
65  \param hop_size number of samples between two consecutive input grains
66  \param samplerate sampling rate of the input signal
67
68*/
69aubio_spectral_whitening_t *new_aubio_spectral_whitening (uint_t buf_size,
70                                                          uint_t hop_size,
71                                                          uint_t samplerate);
72
73/** reset spectral whitening object
74
75  \param o spectral whitening object as returned by new_aubio_spectral_whitening()
76
77 */
78void aubio_spectral_whitening_reset (aubio_spectral_whitening_t * o);
79
80/** set relaxation time for spectral whitening
81
82  \param o spectral whitening object as returned by new_aubio_spectral_whitening()
83  \param relax_time relaxation time in seconds between 20 and 500, defaults 250
84
85  */
86uint_t aubio_spectral_whitening_set_relax_time (aubio_spectral_whitening_t * o,
87    smpl_t relax_time);
88
89/** get relaxation time of spectral whitening
90
91  \param o spectral whitening object as returned by new_aubio_spectral_whitening()
92  \return relaxation time in seconds
93
94*/
95smpl_t aubio_spectral_whitening_get_relax_time (aubio_spectral_whitening_t * o);
96
97/** set floor for spectral whitening
98
99  \param o spectral whitening object as returned by new_aubio_spectral_whitening()
100  \param floor value (typically between 1.e-6 and .2, defaults to 1.e-4)
101
102  */
103uint_t aubio_spectral_whitening_set_floor (aubio_spectral_whitening_t * o,
104    smpl_t floor);
105
106/** get floor of spectral whitening
107
108  \param o spectral whitening object as returned by new_aubio_spectral_whitening()
109  \return floor value
110
111*/
112smpl_t aubio_spectral_whitening_get_floor (aubio_spectral_whitening_t * o);
113
114/** deletion of a spectral whitening
115
116  \param o spectral whitening object as returned by new_aubio_spectral_whitening()
117
118*/
119void del_aubio_spectral_whitening (aubio_spectral_whitening_t * o);
120
121#ifdef __cplusplus
122}
123#endif
124
125#endif /* _AUBIO_SPECTRAL_WHITENING_H */
Note: See TracBrowser for help on using the repository browser.