comparison cq/CQParameters.h @ 176:5b1a1bbd6e7f

Make decimator quality selectable
author Chris Cannam <c.cannam@qmul.ac.uk>
date Tue, 28 Apr 2015 13:53:53 +0100
parents 2705ca19245c
children
comparison
equal deleted inserted replaced
175:aa57e80b6af8 176:5b1a1bbd6e7f
46 BlackmanHarris, 46 BlackmanHarris,
47 Blackman, 47 Blackman,
48 Hann, 48 Hann,
49 }; 49 };
50 50
51 enum DecimatorType {
52 BetterDecimator,
53 FasterDecimator
54 };
55
51 /** 56 /**
52 * Construct a set of parameters with the given input signal 57 * Construct a set of parameters with the given input signal
53 * sample rate, frequency range, and number of bins per 58 * sample rate, frequency range, and number of bins per
54 * octave. The remaining parameters will take their usual 59 * octave. The remaining parameters will take their usual
55 * defaults; if you want to change them, just assign the 60 * defaults; if you want to change them, just assign the
61 int _binsPerOctave) : 66 int _binsPerOctave) :
62 sampleRate(_sampleRate), 67 sampleRate(_sampleRate),
63 minFrequency(_minFrequency), 68 minFrequency(_minFrequency),
64 maxFrequency(_maxFrequency), 69 maxFrequency(_maxFrequency),
65 binsPerOctave(_binsPerOctave), 70 binsPerOctave(_binsPerOctave),
66 q(1.0), // Q scaling factor 71 q(1.0), // Q scaling factor
67 atomHopFactor(0.25), // hop size of shortest temporal atom 72 atomHopFactor(0.25), // hop size of shortest temporal atom
68 threshold(0.0005), // sparsity threshold for resulting kernel 73 threshold(0.0005), // sparsity threshold for resulting kernel
69 window(SqrtBlackmanHarris) // window shape 74 window(SqrtBlackmanHarris), // window shape
75 decimator(BetterDecimator) // decimator quality setting
70 { } 76 { }
71 77
72 /** 78 /**
73 * Sampling rate of input signal. 79 * Sampling rate of input signal.
74 */ 80 */
112 118
113 /** 119 /**
114 * Window shape to use for the Constant-Q kernel atoms. 120 * Window shape to use for the Constant-Q kernel atoms.
115 */ 121 */
116 WindowType window; 122 WindowType window;
123
124 /**
125 * Quality setting for the sample rate decimator.
126 */
127 DecimatorType decimator;
117 }; 128 };
118 129
119 #endif 130 #endif
120 131