Mercurial > hg > silvet
comparison src/Silvet.cpp @ 145:450f9987f041
Update CQ implementation following inverse-CQ merge
author | Chris Cannam |
---|---|
date | Tue, 13 May 2014 14:34:04 +0100 |
parents | 230920148ee5 |
children | d2bc51cc7f57 |
comparison
equal
deleted
inserted
replaced
144:5e9ad8b2d9b1 | 145:450f9987f041 |
---|---|
18 | 18 |
19 #include "maths/MedianFilter.h" | 19 #include "maths/MedianFilter.h" |
20 #include "maths/MathUtilities.h" | 20 #include "maths/MathUtilities.h" |
21 #include "dsp/rateconversion/Resampler.h" | 21 #include "dsp/rateconversion/Resampler.h" |
22 | 22 |
23 #include "constant-q-cpp/cpp-qm-dsp/CQInterpolated.h" | 23 #include "constant-q-cpp/cpp-qm-dsp/CQSpectrogram.h" |
24 | 24 |
25 #include <vector> | 25 #include <vector> |
26 | 26 |
27 #include <cstdio> | 27 #include <cstdio> |
28 | 28 |
324 m_resampler = new Resampler(m_inputSampleRate, processingSampleRate); | 324 m_resampler = new Resampler(m_inputSampleRate, processingSampleRate); |
325 } else { | 325 } else { |
326 m_resampler = 0; | 326 m_resampler = 0; |
327 } | 327 } |
328 | 328 |
329 m_cq = new CQInterpolated | 329 m_cq = new CQSpectrogram |
330 (processingSampleRate, 27.5, processingSampleRate / 3, processingBPO, | 330 (processingSampleRate, 27.5, processingSampleRate / 3, processingBPO, |
331 CQInterpolated::Linear); | 331 CQSpectrogram::InterpolateLinear); |
332 | 332 |
333 for (int i = 0; i < (int)m_postFilter.size(); ++i) { | 333 for (int i = 0; i < (int)m_postFilter.size(); ++i) { |
334 delete m_postFilter[i]; | 334 delete m_postFilter[i]; |
335 } | 335 } |
336 m_postFilter.clear(); | 336 m_postFilter.clear(); |
374 } | 374 } |
375 | 375 |
376 Silvet::FeatureSet | 376 Silvet::FeatureSet |
377 Silvet::getRemainingFeatures() | 377 Silvet::getRemainingFeatures() |
378 { | 378 { |
379 Grid cqout = m_cq->getRemainingBlocks(); | 379 Grid cqout = m_cq->getRemainingOutput(); |
380 FeatureSet fs = transcribe(cqout); | 380 FeatureSet fs = transcribe(cqout); |
381 | 381 |
382 for (int i = 0; i < (int)cqout.size(); ++i) { | 382 for (int i = 0; i < (int)cqout.size(); ++i) { |
383 Feature f; | 383 Feature f; |
384 for (int j = 0; j < (int)cqout[i].size(); ++j) { | 384 for (int j = 0; j < (int)cqout[i].size(); ++j) { |