Mercurial > hg > constant-q-cpp
diff src/CQSpectrogram.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 | 8996465e39fc |
children | b34df30fd7e4 |
line wrap: on
line diff
--- a/src/CQSpectrogram.cpp Fri Jun 20 10:33:11 2014 +0100 +++ b/src/CQSpectrogram.cpp Thu Jul 10 12:19:39 2014 +0100 @@ -71,6 +71,14 @@ int height = cq[i].size(); RealColumn col(height, 0); for (int j = 0; j < height; ++j) { + + 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; + } + col[j] = abs(cq[i][j]); } spec.push_back(col);