comparison src/Silvet.cpp @ 33:e08c330a761d

Drop the latency columns from the CQ start
author Chris Cannam
date Fri, 04 Apr 2014 13:43:51 +0100
parents da54468cc452
children 7d81407a2fd8
comparison
equal deleted inserted replaced
32:da54468cc452 33:e08c330a761d
298 298
299 int spacing = processingSampleRate / 100; 299 int spacing = processingSampleRate / 100;
300 300
301 Grid out; 301 Grid out;
302 302
303 //!!! nb we count the CQ latency in terms of processing hops, but
304 //!!! actually it isn't guaranteed to be an exact number (in fact
305 //!!! it probably isn't) so this is imprecise -- fix
306 int latentColumns = m_cq->getLatency() / m_cq->getColumnHop();
307
303 for (int i = 0; i < width; ++i) { 308 for (int i = 0; i < width; ++i) {
309
310 if (m_columnCount < latentColumns) {
311 ++m_columnCount;
312 continue;
313 }
304 314
305 int prevSampleNo = (m_columnCount - 1) * m_cq->getColumnHop(); 315 int prevSampleNo = (m_columnCount - 1) * m_cq->getColumnHop();
306 int sampleNo = m_columnCount * m_cq->getColumnHop(); 316 int sampleNo = m_columnCount * m_cq->getColumnHop();
307 317
308 bool select = (sampleNo / spacing != prevSampleNo / spacing); 318 bool select = (sampleNo / spacing != prevSampleNo / spacing);
319 329
320 for (int j = 0; j < processingHeight; ++j) { 330 for (int j = 0; j < processingHeight; ++j) {
321 331
322 int ix = inCol.size() - j - 55; 332 int ix = inCol.size() - j - 55;
323 333
334 //!!! note these filters introduce more latency
335
324 double val = inCol[ix]; 336 double val = inCol[ix];
325 m_filterA[j]->push(val); 337 m_filterA[j]->push(val);
326 338
327 double a = m_filterA[j]->get(); 339 double a = m_filterA[j]->get();
328 m_filterB[j]->push(std::min(a, val)); 340 m_filterB[j]->push(std::min(a, val));