comparison SpectrogramProcessor.cpp @ 24:957b83524c06

* Replacing loop unsigned ints with ints
author Carl Bussey <c.bussey@se10.qmul.ac.uk>
date Tue, 19 Aug 2014 18:20:26 +0100
parents 12b952286959
children fe23998968b4
comparison
equal deleted inserted replaced
23:7d36c742a183 24:957b83524c06
59 //process method 59 //process method
60 Spectrogram SpectrogramProcessor::process(const float * const pInput, const size_t &inputLength, const float * pWindow, const bool &transposeOutput) const 60 Spectrogram SpectrogramProcessor::process(const float * const pInput, const size_t &inputLength, const float * pWindow, const bool &transposeOutput) const
61 { 61 {
62 Spectrogram spectrogram; 62 Spectrogram spectrogram;
63 63
64 unsigned int readBlockPointerIndex = 0; 64 int readBlockPointerIndex = 0;
65 unsigned int writeBlockPointer = 0; 65 int writeBlockPointer = 0;
66 66
67 //cout << m_hopSize << endl; 67 //cout << m_hopSize << endl;
68 while(readBlockPointerIndex <= inputLength) { 68 while(readBlockPointerIndex <= (int)inputLength) {
69 69
70 int readPointer = readBlockPointerIndex - m_windowLength/2; 70 int readPointer = readBlockPointerIndex - m_windowLength/2;
71 for (int n = 0; n < (int)m_windowLength; n++){ 71 for (int n = 0; n < (int)m_windowLength; n++){
72 if(readPointer < 0 || readPointer >= (int)inputLength){ 72 if(readPointer < 0 || readPointer >= (int)inputLength){
73 m_pFftInput[n] = 0.0; //pad with zeros 73 m_pFftInput[n] = 0.0; //pad with zeros