TWOEARS / auditory-front-end

Two!Ears Auditory Model - Auditory front-end module
http://docs.twoears.eu/en/latest/afe/
GNU General Public License v2.0
16 stars 10 forks source link

crosscorrelationProc: consistent initialization of output matrix #8

Closed kashefy closed 8 years ago

kashefy commented 8 years ago

When processing very small chunks of data nFrames is set to zero. However, there is a discrepancy in how the dimensions of the output matrix are set in the processChunk() method from crosscorrelationProc vs. the function frameData().

processChunk() uses max(1, nFrames) while frameData() uses max(0, nFrames) for the first dimension of the output matrix. This is only relevant when the chunk is very small resulting in nFrames < 1.

This changes processChunk() to set the first dimension of the output matrix using max(0, nFrames) the same way as done in frameData() when padding is switched off.