Mercurial > hg > constant-q-cpp
comparison src/ConstantQ.cpp @ 147:1060a19e2334
Report validity of CQKernel construction, and avoid NaN values for invalid parameters. Also documentation.
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Thu, 10 Jul 2014 12:19:39 +0100 |
parents | ff8ae033615f |
children | 242bf7bc38ce |
comparison
equal
deleted
inserted
replaced
146:0cbd9c904dbb | 147:1060a19e2334 |
---|---|
90 { | 90 { |
91 m_octaves = int(ceil(log2(m_maxFrequency / m_minFrequency))); | 91 m_octaves = int(ceil(log2(m_maxFrequency / m_minFrequency))); |
92 m_kernel = new CQKernel(m_inparams); | 92 m_kernel = new CQKernel(m_inparams); |
93 m_p = m_kernel->getProperties(); | 93 m_p = m_kernel->getProperties(); |
94 | 94 |
95 if (!m_kernel->isValid()) { | |
96 return; | |
97 } | |
98 | |
95 // Use exact powers of two for resampling rates. They don't have | 99 // Use exact powers of two for resampling rates. They don't have |
96 // to be related to our actual samplerate: the resampler only | 100 // to be related to our actual samplerate: the resampler only |
97 // cares about the ratio, but it only accepts integer source and | 101 // cares about the ratio, but it only accepts integer source and |
98 // target rates, and if we start from the actual samplerate we | 102 // target rates, and if we start from the actual samplerate we |
99 // risk getting non-integer rates for lower octaves | 103 // risk getting non-integer rates for lower octaves |