Mercurial > hg > constant-q-cpp
comparison 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 |
comparison
equal
deleted
inserted
replaced
146:0cbd9c904dbb | 147:1060a19e2334 |
---|---|
69 RealBlock spec; | 69 RealBlock spec; |
70 for (int i = 0; i < width; ++i) { | 70 for (int i = 0; i < width; ++i) { |
71 int height = cq[i].size(); | 71 int height = cq[i].size(); |
72 RealColumn col(height, 0); | 72 RealColumn col(height, 0); |
73 for (int j = 0; j < height; ++j) { | 73 for (int j = 0; j < height; ++j) { |
74 | |
75 if (isnan(cq[i][j].real())) { | |
76 cerr << "WARNING: NaN in real at (" << i << "," << j << ")" << endl; | |
77 } | |
78 if (isnan(cq[i][j].imag())) { | |
79 cerr << "WARNING: NaN in imag at (" << i << "," << j << ")" << endl; | |
80 } | |
81 | |
74 col[j] = abs(cq[i][j]); | 82 col[j] = abs(cq[i][j]); |
75 } | 83 } |
76 spec.push_back(col); | 84 spec.push_back(col); |
77 } | 85 } |
78 | 86 |