c@127
|
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
|
c@127
|
2 /*
|
c@127
|
3 Constant-Q library
|
c@127
|
4 Copyright (c) 2013-2014 Queen Mary, University of London
|
c@127
|
5
|
c@127
|
6 Permission is hereby granted, free of charge, to any person
|
c@127
|
7 obtaining a copy of this software and associated documentation
|
c@127
|
8 files (the "Software"), to deal in the Software without
|
c@127
|
9 restriction, including without limitation the rights to use, copy,
|
c@127
|
10 modify, merge, publish, distribute, sublicense, and/or sell copies
|
c@127
|
11 of the Software, and to permit persons to whom the Software is
|
c@127
|
12 furnished to do so, subject to the following conditions:
|
c@127
|
13
|
c@127
|
14 The above copyright notice and this permission notice shall be
|
c@127
|
15 included in all copies or substantial portions of the Software.
|
c@127
|
16
|
c@127
|
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
c@127
|
18 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
c@127
|
19 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
c@127
|
20 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
c@127
|
21 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
c@127
|
22 CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
c@127
|
23 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
c@127
|
24
|
c@127
|
25 Except as contained in this notice, the names of the Centre for
|
c@127
|
26 Digital Music; Queen Mary, University of London; and Chris Cannam
|
c@127
|
27 shall not be used in advertising or otherwise to promote the sale,
|
c@127
|
28 use or other dealings in this Software without prior written
|
c@127
|
29 authorization.
|
c@127
|
30 */
|
c@127
|
31
|
c@127
|
32 #ifndef CQ_PARAMETERS_H
|
c@127
|
33 #define CQ_PARAMETERS_H
|
c@127
|
34
|
c@127
|
35 class CQParameters
|
c@127
|
36 {
|
c@127
|
37 public:
|
c@127
|
38 enum WindowType {
|
c@127
|
39 SqrtBlackmanHarris,
|
c@127
|
40 SqrtBlackman,
|
c@127
|
41 SqrtHann,
|
c@127
|
42 BlackmanHarris,
|
c@127
|
43 Blackman,
|
c@127
|
44 Hann,
|
c@127
|
45 };
|
c@127
|
46
|
c@127
|
47 CQParameters(double _sampleRate,
|
c@127
|
48 double _minFrequency,
|
c@127
|
49 double _maxFrequency,
|
c@127
|
50 int _binsPerOctave) :
|
c@127
|
51 sampleRate(_sampleRate),
|
c@127
|
52 minFrequency(_minFrequency),
|
c@127
|
53 maxFrequency(_maxFrequency),
|
c@127
|
54 binsPerOctave(_binsPerOctave),
|
c@127
|
55 q(1.0), // Q scaling factor
|
c@127
|
56 atomHopFactor(0.25), // hop size of shortest temporal atom
|
c@127
|
57 threshold(0.0005), // sparsity threshold for resulting kernel
|
c@127
|
58 window(SqrtBlackmanHarris) // window shape
|
c@127
|
59 { }
|
c@127
|
60
|
c@127
|
61 double sampleRate;
|
c@127
|
62 double minFrequency;
|
c@127
|
63 double maxFrequency;
|
c@127
|
64 int binsPerOctave;
|
c@127
|
65
|
c@127
|
66 double q;
|
c@127
|
67 double atomHopFactor;
|
c@127
|
68 double threshold;
|
c@127
|
69 WindowType window;
|
c@127
|
70 };
|
c@127
|
71
|
c@127
|
72 #endif
|
c@127
|
73
|
c@127
|
74
|
c@127
|
75
|