Mercurial > hg > vamp-tempogram
changeset 27:a3a37c8dcee7
* Fixed bug causing ACT not to work
author | Carl Bussey <c.bussey@se10.qmul.ac.uk> |
---|---|
date | Wed, 20 Aug 2014 16:48:54 +0100 |
parents | ff6110f1144b |
children | 723af5b3303a |
files | AutocorrelationProcessor.cpp AutocorrelationProcessor.h |
diffstat | 2 files changed, 3 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/AutocorrelationProcessor.cpp Wed Aug 20 16:32:52 2014 +0100 +++ b/AutocorrelationProcessor.cpp Wed Aug 20 16:48:54 2014 +0100 @@ -48,13 +48,13 @@ { vector<float> autocorrelation; - int N = m_windowLength/m_lagIncrement; + int N = m_windowLength; for (int lag = 0; lag < N; lag++){ float sum = 0; - for (int n = 0; n < (int)m_windowLength-lag; n++){ - sum += m_blockInput[lag]*m_blockInput[n+lag]; + for (int n = 0; n < N-lag; n++){ + sum += m_blockInput[n]*m_blockInput[n+lag]; } autocorrelation.push_back(sum/(2*N + 1 - lag)); }