comparison src/Silvet.cpp @ 163:6e9ddd07dc3c

Minor tidy
author Chris Cannam
date Tue, 20 May 2014 15:56:57 +0100
parents 03ba9b25e0d0
children 629c9525b815
comparison
equal deleted inserted replaced
162:03ba9b25e0d0 163:6e9ddd07dc3c
362 double sum = 0.0; 362 double sum = 0.0;
363 for (int j = 0; j < processingHeight; ++j) { 363 for (int j = 0; j < processingHeight; ++j) {
364 sum += filtered.at(i).at(j); 364 sum += filtered.at(i).at(j);
365 } 365 }
366 366
367 // cerr << "sum: " << sum << endl;
368
369 if (sum < 1e-5) continue; 367 if (sum < 1e-5) continue;
370 368
371 EM em(&m_instruments[m_instrument], m_hqMode); 369 EM em(&m_instruments[m_instrument], m_hqMode);
372 370
373 for (int j = 0; j < iterations; ++j) { 371 for (int j = 0; j < iterations; ++j) {
374 em.iterate(filtered.at(i).data()); 372 em.iterate(filtered.at(i).data());
375 } 373 }
376 374
377 const float *pitches = em.getPitchDistribution(); 375 const float *pitches = em.getPitchDistribution();
378 376
379 //!!! note: check the CQ output (and most immediately, the sum values here) against the MATLAB implementation
380
381 for (int j = 0; j < processingNotes; ++j) { 377 for (int j = 0; j < processingNotes; ++j) {
382 pitchMatrix[i][j] = pitches[j] * sum; 378 pitchMatrix[i][j] = pitches[j] * sum;
383 } 379 }
384 } 380 }
385 381