|
Constant-Q Library
|
00001 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ 00002 /* 00003 Constant-Q library 00004 Copyright (c) 2013-2014 Queen Mary, University of London 00005 00006 Permission is hereby granted, free of charge, to any person 00007 obtaining a copy of this software and associated documentation 00008 files (the "Software"), to deal in the Software without 00009 restriction, including without limitation the rights to use, copy, 00010 modify, merge, publish, distribute, sublicense, and/or sell copies 00011 of the Software, and to permit persons to whom the Software is 00012 furnished to do so, subject to the following conditions: 00013 00014 The above copyright notice and this permission notice shall be 00015 included in all copies or substantial portions of the Software. 00016 00017 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 00018 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00019 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 00020 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 00021 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 00022 CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 00023 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 00024 00025 Except as contained in this notice, the names of the Centre for 00026 Digital Music; Queen Mary, University of London; and Chris Cannam 00027 shall not be used in advertising or otherwise to promote the sale, 00028 use or other dealings in this Software without prior written 00029 authorization. 00030 */ 00031 00032 #ifndef CQ_PARAMETERS_H 00033 #define CQ_PARAMETERS_H 00034 00039 class CQParameters 00040 { 00041 public: 00042 enum WindowType { 00043 SqrtBlackmanHarris, 00044 SqrtBlackman, 00045 SqrtHann, 00046 BlackmanHarris, 00047 Blackman, 00048 Hann, 00049 }; 00050 00058 CQParameters(double _sampleRate, 00059 double _minFrequency, 00060 double _maxFrequency, 00061 int _binsPerOctave) : 00062 sampleRate(_sampleRate), 00063 minFrequency(_minFrequency), 00064 maxFrequency(_maxFrequency), 00065 binsPerOctave(_binsPerOctave), 00066 q(1.0), // Q scaling factor 00067 atomHopFactor(0.25), // hop size of shortest temporal atom 00068 threshold(0.0005), // sparsity threshold for resulting kernel 00069 window(SqrtBlackmanHarris) // window shape 00070 { } 00071 00075 double sampleRate; 00076 00082 double minFrequency; 00083 00087 double maxFrequency; 00088 00092 int binsPerOctave; 00093 00099 double q; 00100 00105 double atomHopFactor; 00106 00111 double threshold; 00112 00116 WindowType window; 00117 }; 00118 00119 #endif 00120
1.7.6.1