changeset 33:a824d7d14eb9

Clamp band boundaries to block size
author Chris Cannam
date Thu, 04 Sep 2014 10:40:31 +0100
parents 023d12fb71b1
children 2b2e707c8c20
files NoveltyCurveProcessor.cpp
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/NoveltyCurveProcessor.cpp	Thu Sep 04 10:08:47 2014 +0100
+++ b/NoveltyCurveProcessor.cpp	Thu Sep 04 10:40:31 2014 +0100
@@ -37,9 +37,11 @@
     for (unsigned int band = 1; band < m_numberOfBands; band++){
         float lowFreq = 500*pow(2.5, (int)band-1);
         m_pBandBoundaries[band] = m_fftLength*lowFreq/m_samplingFrequency;
+	if (m_pBandBoundaries[band] > (int)m_blockSize) {
+	    m_pBandBoundaries[band] = m_blockSize;
+	}
     }
     m_pBandBoundaries[m_numberOfBands] = m_blockSize;
-    
     m_pBandSum = new float [m_numberOfBands];
 }