1 | /* |
---|
2 | Copyright (C) 2017 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 | Constant-Q Transform |
---|
24 | |
---|
25 | TODO add long description |
---|
26 | |
---|
27 | \example spectral/test-constantq.c |
---|
28 | |
---|
29 | */ |
---|
30 | |
---|
31 | #ifndef AUBIO_CONSTANTQ_H |
---|
32 | #define AUBIO_CONSTANTQ_H |
---|
33 | |
---|
34 | #ifdef __cplusplus |
---|
35 | extern "C" { |
---|
36 | #endif |
---|
37 | |
---|
38 | /** Constant-Q transofmr object |
---|
39 | |
---|
40 | This object computes the forward Constant-Q transform. |
---|
41 | |
---|
42 | */ |
---|
43 | typedef struct _aubio_constantq_t aubio_constantq_t; |
---|
44 | |
---|
45 | /** create new constant-Q computation object |
---|
46 | |
---|
47 | \param size length of the Constant-Q |
---|
48 | \param samplerate sampling rate of the input signal |
---|
49 | \param bins_per_octave number of bins per octave |
---|
50 | |
---|
51 | */ |
---|
52 | aubio_constantq_t * new_aubio_constantq(uint_t size, uint_t samplerate, |
---|
53 | uint_t bins_per_octave); |
---|
54 | |
---|
55 | /** compute constant-Q |
---|
56 | |
---|
57 | \param s constant-Q object as returned by new_aubio_constantq |
---|
58 | \param input input fft grain |
---|
59 | \param cqt_output transformed input array |
---|
60 | |
---|
61 | */ |
---|
62 | void aubio_constantq_do (aubio_constantq_t *s, const cvec_t * input, |
---|
63 | fvec_t * cqt_output); |
---|
64 | |
---|
65 | /** delete constant-q object |
---|
66 | |
---|
67 | \param s constant-q object as returned by new_aubio_constantq |
---|
68 | |
---|
69 | */ |
---|
70 | void del_aubio_constantq (aubio_constantq_t *s); |
---|
71 | |
---|
72 | /** get number of output bins of a constant-q object |
---|
73 | |
---|
74 | \param s constant-q object as returned by new_aubio_constantq |
---|
75 | \return number of output bins |
---|
76 | |
---|
77 | */ |
---|
78 | uint_t aubio_constantq_get_numbins (aubio_constantq_t *s); |
---|
79 | |
---|
80 | #ifdef __cplusplus |
---|
81 | } |
---|
82 | #endif |
---|
83 | |
---|
84 | #endif /* AUBIO_CONSTANTQ_H */ |
---|