Mercurial > hg > constant-q-cpp
diff src/CQSpectrogram.cpp @ 156:b34df30fd7e4
Defensive initialisation
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Mon, 04 Aug 2014 09:21:48 +0100 |
parents | 1060a19e2334 |
children |
line wrap: on
line diff
--- a/src/CQSpectrogram.cpp Mon Jul 14 12:44:37 2014 +0100 +++ b/src/CQSpectrogram.cpp Mon Aug 04 09:21:48 2014 +0100 @@ -37,6 +37,8 @@ using std::cerr; using std::endl; +//#define DEBUG_CQSPECTROGRAM 1 + CQSpectrogram::CQSpectrogram(CQParameters params, Interpolation interpolation) : m_cq(params), @@ -71,14 +73,14 @@ int height = cq[i].size(); RealColumn col(height, 0); for (int j = 0; j < height; ++j) { - +#ifdef DEBUG_CQSPECTROGRAM if (isnan(cq[i][j].real())) { cerr << "WARNING: NaN in real at (" << i << "," << j << ")" << endl; } if (isnan(cq[i][j].imag())) { cerr << "WARNING: NaN in imag at (" << i << "," << j << ")" << endl; } - +#endif col[j] = abs(cq[i][j]); } spec.push_back(col);